-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from revjet-qa/wait_not_present_steps
"Wait" and "is not present" steps are added
- Loading branch information
Showing
11 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ downloads | |
*~ | ||
.idea | ||
.vscode | ||
errorShots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* eslint new-cap: 0 */ | ||
|
||
const { defineSupportCode } = require('cucumber'); | ||
const { dictionaryObject, getDictionaryObject } = require('../helpers/objects.processor'); | ||
const { _r, getInteger } = require('../helpers/utils'); | ||
|
||
|
||
module.exports = function () { | ||
defineSupportCode(({ When }) => { | ||
|
||
When(_r(`I wait ${dictionaryObject} ms$`), (timeObject) => { | ||
/** | ||
* Wait in milliseconds | ||
* @type {String} | ||
*/ | ||
const timeValue = getDictionaryObject.call(this, timeObject); | ||
const time = getInteger(timeValue); | ||
|
||
browser.pause(time); | ||
}); | ||
|
||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var timeout = 5000; | ||
|
||
setTimeout(function () { | ||
document.getElementById('div_timeout').remove(); | ||
}, timeout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#div_timeout { | ||
color: red; | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let e = {}; | ||
|
||
e.txtTimeout = '500'; | ||
|
||
module.exports = e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
let e = {}; | ||
|
||
e.txtHeader = '//*[@id="header"]'; | ||
e.divTimeout = '//*[@id="div_timeout"]'; | ||
|
||
module.exports = e; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@Fast | ||
|
||
Feature: Present / Not present | ||
In order to check steps with appearing/disappearing elements | ||
As a developer | ||
I want to check that certain value is present and not present after time | ||
|
||
Scenario: Check I write method | ||
Given I open "http://localhost:9000" | ||
Then txtHeader from main page should be present | ||
Then divTimeout from main page should be present | ||
When I wait "5000" ms | ||
Then divTimeout from main page should not be present | ||
Then txtHeader from main page should be present | ||
Then I wait txtTimeout from values dictionary ms | ||
Then divTimeout from main page should not be present | ||
Then txtHeader from main page should be present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters