Skip to content

Commit

Permalink
UpdateCI - Functional tests - Added testCafe quarantineMode parameter…
Browse files Browse the repository at this point in the history
… and applied it for scheduler.
  • Loading branch information
AntonSermyazhko committed Jan 22, 2020
1 parent c736c2b commit 62f987f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ matrix:
- { TARGET: test, BROWSER: firefox, JQUERY: true, CONSTEL: ui.scheduler }
- { TARGET: test, BROWSER: firefox, JQUERY: true, CONSTEL: viz }
- { TARGET: test_functional, COMPONENT: dataGrid }
- { TARGET: test_functional, COMPONENT: scheduler }
- { TARGET: test_functional, COMPONENT: scheduler, QUARANTINE_MODE: true }
- { TARGET: test_functional, COMPONENT: editors }
- { TARGET: test_functional, COMPONENT: navigation }
- { TARGET: test_themebuilder }
5 changes: 3 additions & 2 deletions docker-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ function run_test_functional {
npm i
npm run build

local args="--browsers chrome:headless";
[ "$COMPONENT" ] && args="$args --componentFolder $COMPONENT";
local args="--browsers=chrome:headless";
[ -n "$COMPONENT" ] && args="$args --componentFolder=$COMPONENT";
[ -n "$QUARANTINE_MODE" ] && args="$args --quarantineMode=true";

npm run test-functional -- $args
}
Expand Down
15 changes: 12 additions & 3 deletions testing/functional/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,30 @@ createTestCafe('localhost', 1437, 1438)
.then(tc => {
testCafe = tc;

const con = console;
const args = getArgs();
const testName = args.test.trim();
let componentFolder = args.componentFolder.trim();

componentFolder = componentFolder ? `${componentFolder}/**` : '**';
const browsers = args.browsers.split(' ');
const quarantineMode = args.quarantineMode;

con.log('componentFolder', componentFolder);
con.log('browsers', browsers);
con.log('quarantineMode', quarantineMode);
con.log('testName', testName);

const runner = testCafe.createRunner()
.browsers(args.browsers.split(' '))
.browsers(browsers)
.src([`./testing/functional/tests/${componentFolder}/*.ts`]);

if(testName) {
runner.filter(name => name === testName);
}

return runner.run({
quarantineMode: false
quarantineMode: quarantineMode
});
})
.then(failedCount => {
Expand All @@ -38,7 +46,8 @@ function getArgs() {
default: {
browsers: 'chrome',
test: '',
componentFolder: ''
componentFolder: '',
quarantineMode: false
}
});
}

0 comments on commit 62f987f

Please sign in to comment.