Skip to content

Commit 465098d

Browse files
Add shortcuts for seconds and minutes next to the waiting time value #189
1 parent 32783c4 commit 465098d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/features/test--when--i-wait-time.feature

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ Feature: An example test to wait for a specific maximum number of seconds/minute
99
And I wait 6 seconds
1010
Then I should see "Welcome with waiting full time"
1111

12-
Scenario: Check waiting a maximum of 6 seconds for the page content to load.
12+
Scenario: Check waiting 3s for the page content to load.
13+
Given I am on the homepage
14+
When I go to "/test--when-i-wait-specific-time.html"
15+
And I wait 3s
16+
Then I should see "Welcome with waiting full time"
17+
18+
Scenario: Check waiting a maximum of 6 seconds for the page content to load.
1319
Given I am on the homepage
1420
When I go to "/test--when-i-wait-max-of-time.html"
1521
And I wait max of 6 seconds

tests/step-definitions/webship.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,10 @@ Then(/^the checkbox "([^"]*)?" is not checked$/, function (checkbox) {
889889
* Wait a specific number of seconds.
890890
* Example: When I wait 1 second
891891
* Example: When I wait 5 seconds
892+
* Example: When I wait 3s
892893
*
893894
*/
894-
When(/^(I|we)* wait (\d*) second(s)*$/, function (pronoundCase, number, withS) {
895+
When(/^(I|we)* wait (\d*)( second)*(s)*$/, function (pronoundCase, number, withWord, withS) {
895896
var waitTime = number * 1000;
896897
return browser.pause(waitTime);
897898
});
@@ -901,7 +902,7 @@ When(/^(I|we)* wait (\d*) second(s)*$/, function (pronoundCase, number, withS) {
901902
* Example: When I wait max of 6 seconds
902903
*
903904
*/
904-
When(/^(I|we)* wait max of (\d*) second(s)*$/, function (pronoundCase, number, withS) {
905+
When(/^(I|we)* wait max of (\d*)( second)*(s)*$/, function (pronoundCase, number, withWord, withS) {
905906
var waitTime = number * 1000;
906907
return browser.waitForElementPresent('body', waitTime);
907908
});
@@ -912,7 +913,7 @@ When(/^(I|we)* wait max of (\d*) second(s)*$/, function (pronoundCase, number, w
912913
* Example: When I wait 5 minutes
913914
*
914915
*/
915-
When(/^(I|we)* wait (\d*) minute(s)*$/, function (pronoundCase, number, withS) {
916+
When(/^(I|we)* wait (\d*)( minute)*(m)*$/, function (pronoundCase, number, withWord, withM) {
916917
var waitTime = number * 1000 * 60;
917918
return browser.pause(waitTime);
918919
});
@@ -922,7 +923,7 @@ When(/^(I|we)* wait (\d*) minute(s)*$/, function (pronoundCase, number, withS) {
922923
* Example: When I wait max of 6 minutes
923924
*
924925
*/
925-
When(/^(I|we)* wait max of (\d*) minute(s)*$/, function (pronoundCase, number, withS) {
926+
When(/^(I|we)* wait max of (\d*)( minute)*(m)*$/, function (pronoundCase, number, withWord, withM) {
926927
var waitTime = number * 1000 * 60;
927928
return browser.waitForElementPresent('body', waitTime);
928929
});

0 commit comments

Comments
 (0)