Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityvi committed May 26, 2023
1 parent 9e965ba commit 687ab5c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const {Then} = require('@cucumber/cucumber');


Then('I check if webdriver is present and contains text', async function() {
browser.globals.test_calls++;

await browser.expect.element('#webdriver').text.to.contain('xx');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const {Given, Then} = require('@cucumber/cucumber');

Given('I navigate to localhost', function() {

return browser.navigateTo('http://localhost');
});

Then('I check if webdriver is present', function() {

return browser.assert.elementPresent('#webdriver');
});

36 changes: 36 additions & 0 deletions test/cucumber-integration-tests/testCucumberTestsInParallel.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path');
const assert = require('assert');
const Globals = require('../lib/globals/commands.js');
const commandMocks = require('../lib/command-mocks.js');
const common = require('../common.js');
const MockServer = require('../lib/mockserver.js');

Expand Down Expand Up @@ -39,4 +40,39 @@ describe('Cucumber integration - parallel running single formatter', function()
assert.strictEqual(errorOrFailed, true);
});
});

it('testCucumberSampleTests in parallel with multiple step definition files', function() {

commandMocks.elementText('5cc459b8-36a8-3042-8b4a-258883ea642b', 'xx');

const source = [
path.join(__dirname, './sample_cucumber_tests/parallelWithMultipleDefinition')
];

const {runTests} = common.require('index.js');

return runTests({
source,
parallel: true,
verbose: true,
timeout: 10,
silent: false,
tags: ['not @fail'],
format: 'progress',
config: path.join(__dirname, '../extra/cucumber-config-parallel.js'),
'format-options': '',
['retry-interval']: 5,
['persist-globals']: true,
['webdriver-host']: 'localhost',
['start-process']: false,
['webdriver-port']: 10190
}, {})
.then(errorOrFailed => {
assert.strictEqual(errorOrFailed, false);
});
});




});

0 comments on commit 687ab5c

Please sign in to comment.