Skip to content

Commit

Permalink
TASK: Patch template to include script to fail on console.error
Browse files Browse the repository at this point in the history
Can be removed when this is implemented:
DevExpress/testcafe#1738
  • Loading branch information
dimaip committed Aug 30, 2017
1 parent 0ef8828 commit a491539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 4 additions & 0 deletions Build/TravisCi/InstallScripts/IntegrationTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ mv temp Packages/Application/Neos.Neos.Ui
# Move the configuration files into place.
cp Packages/Application/Neos.Neos.Ui/Build/TravisCi/Settings.yaml Configuration/Settings.yaml

# Patch template to include script to fail on console.error.
# TODO: Can be removed when this is implemented: https://github.com/DevExpress/testcafe/issues/1738
sed -i 's/<title>/<script><![CDATA[ const originalError = console.error; console.error = (msg, trace) => { if (msg === 'uncaught') { throw new Error(trace);} else { throw new Error(msg);}};]]><\/script>\r\n<title>/g' Resources/Private/Templates/Backend/Index.html

# Setup the database and import the demo site package.
mysql -e 'create database neos collate utf8_unicode_ci;'
./flow cache:warmup
Expand Down
7 changes: 0 additions & 7 deletions Tests/IntegrationTests/contentModule.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import {Selector, Role, ClientFunction} from 'testcafe';
import ReactSelector from 'testcafe-react-selectors';

const handleErrors = ClientFunction(() => {
console.error = msg => {
throw new Error(msg);
};
});

const adminUrl = 'http://127.0.0.1:8081/neos!';

const adminUser = Role(adminUrl, async t => {
Expand All @@ -19,7 +13,6 @@ const adminUser = Role(adminUrl, async t => {
fixture `ContentCanvas`
.beforeEach(async t => {
await t.useRole(adminUser);
await handleErrors();
});

test('Can open node creation dialog', async t => {
Expand Down

0 comments on commit a491539

Please sign in to comment.