webship-js 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.circleci/config.yml +8 -5
  2. package/.github/workflows/github-actions.yml +26 -7
  3. package/.gitlab-ci.yml +23 -35
  4. package/CNAME +1 -0
  5. package/README.md +4 -7
  6. package/assets/config_templates/circleci-linux-chrome.conf.js +8 -3
  7. package/bitbucket-pipelines.yml +1 -1
  8. package/examples/test--then--i-should--not--see-text-in-element.html +1 -1
  9. package/examples/test--then--i-should--see-text-in-element.html +48 -0
  10. package/examples/test--when--i-check-uncheck-checkbox.html +5 -3
  11. package/examples/test-acceptable-url-path.html +11 -0
  12. package/generate-reports.js +1 -1
  13. package/lib/custom-assertions/{smartCheckboxChecked.js → checkboxChecked.js} +43 -10
  14. package/lib/custom-assertions/{smartElementContainsCss.js → elementContainsCss.js} +42 -10
  15. package/lib/custom-assertions/{smartElementContains.js → elementContainsText.js} +42 -10
  16. package/lib/custom-assertions/responseStatus.js +13 -0
  17. package/lib/custom-assertions/shouldVisible.js +8 -0
  18. package/lib/custom-assertions/textMatching.js +34 -2
  19. package/lib/custom-commands/checkItem.js +44 -0
  20. package/lib/custom-commands/{smartUploadFile.js → fileUpload.js} +0 -1
  21. package/lib/custom-commands/press.js +3 -0
  22. package/lib/custom-commands/uncheckItem.js +44 -0
  23. package/lib/custom-commands/wait.js +12 -0
  24. package/nightwatch.conf.js +6 -2
  25. package/package.json +14 -14
  26. package/tests/features/test--given--i-am-on-homepage.feature +9 -5
  27. package/tests/features/test--then--i-should--not--see-text-in-element.feature +8 -8
  28. package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +0 -5
  29. package/tests/features/test--then--i-should--see-text-matching-pattern.feature +0 -0
  30. package/tests/features/test--then--i-should-be-on-page.feature +1 -1
  31. package/tests/features/test--then--the-checkbox-is-checked.feature +9 -9
  32. package/tests/features/test--then--the-checkbox-should-be-checked.feature +3 -3
  33. package/tests/features/test--then--the-element-should_not-contain-cssproperty.feature +2 -2
  34. package/tests/features/test--then--the-field-should-contain-value.feature +4 -4
  35. package/tests/features/test--then--the-response-status-code-should-be.feature +4 -4
  36. package/tests/features/test--then--the-url-should-match.feature +7 -0
  37. package/tests/features/test--when--i-attach-file-to-feild.feature +5 -5
  38. package/tests/features/test--when--i-check-checkbox.feature +13 -9
  39. package/tests/features/test--when--i-click-link.feature +2 -2
  40. package/tests/features/test--when--i-fill-in.feature +8 -8
  41. package/tests/features/test--when--i-go-to-homepage.feature +10 -0
  42. package/tests/features/test--when--i-move-forward-backward-one-page.feature +2 -2
  43. package/tests/features/test--when--i-select-option-from-dropdownlist.feature +1 -1
  44. package/tests/step-definitions/webship.js +399 -179
  45. package/lib/custom-commands/smartCheckItem.js +0 -39
  46. package/lib/custom-commands/smartPressButton.js +0 -12
  47. package/lib/custom-commands/smartUncheckItem.js +0 -39
  48. package/tests/features/test--when--i-uncheck-checkbox.feature +0 -18
  49. /package/lib/custom-commands/{smartClickLink.js → clickLink.js} +0 -0
  50. /package/lib/custom-commands/{smartFillTextInput.js → fillTextInput.js} +0 -0
  51. /package/lib/custom-commands/{smartSelectOption.js → selectOption.js} +0 -0
@@ -1,12 +1,44 @@
1
1
 
2
2
  module.exports.assertion = function (negativeCase, textPattern, element) {
3
3
 
4
+ this.expected = function () {
5
+ return negativeCase ? `not contains '${expectedText}'` : `contains '${expectedText}'`;
6
+ };
7
+
8
+ this.evaluate = function (value) {
9
+ return (typeof value === 'string') && (value.includes(expectedText) !== negativeCase);
10
+ };
11
+
12
+ this.value = function (result) {
13
+ return result.value;
14
+ };
15
+
16
+ /**
17
+ * The command which is to be executed by the assertion runner; Nightwatch api is available as browser.api
18
+ * @param {function} callback
19
+ */
20
+ this.command = function(callback) {
21
+ setTimeout(function() {
22
+ callback({
23
+ value: ''
24
+ });
25
+ }, 1000);
26
+ };
27
+
28
+ this.pass = function (value) {
29
+ return this.evaluate(value);
30
+ };
31
+
32
+ this.failure = function (result) {
33
+ return result === false || result && result.status === -1;
34
+ };
35
+
4
36
  browser.elements('css selector', element, function (elements) {
5
37
  elements.value.forEach(function (elementsObj) {
6
38
  if (negativeCase) {
7
- return browser.assert.not.textMatches(elementsObj, textPattern);
39
+ return browser.assert.not.textMatches(elementsObj, textPattern).end();
8
40
  }
9
- return browser.assert.textMatches(elementsObj, textPattern);
41
+ return browser.assert.textMatches(elementsObj, textPattern).end();
10
42
  });
11
43
  });
12
44
  }
@@ -0,0 +1,44 @@
1
+ module.exports.command = function (item) {
2
+
3
+ browser.element('css selector', item, function (result) {
4
+ if (result.status === 0) {
5
+ return browser.click(item);
6
+ } else {
7
+ browser.element('css selector', '#' + item, function (result) {
8
+ if (result.status === 0) {
9
+ return browser.click('#' + item);
10
+ } else {
11
+ browser.element('css selector', '.' + item, function (result) {
12
+ if (result.status === 0) {
13
+ return browser.click('.' + item);
14
+ } else {
15
+ browser.element('css selector', 'input[name="' + item + '"]', function (result) {
16
+ if (result.status === 0) {
17
+ return browser.click('input[name="' + item + '"]');
18
+ } else {
19
+ browser.element('css selector', 'input[value="' + item + '"]', function (result) {
20
+ if (result.status === 0) {
21
+ return browser.click('input[value="' + item + '"]');
22
+ } else {
23
+ browser.elements('css selector', 'label', function (elements) {
24
+ elements.value.forEach(function (elementsObj) {
25
+ browser.elementIdText(elementsObj.ELEMENT, function (result) {
26
+ if (result.value == item) {
27
+ browser.getAttribute(elementsObj, "for", function (forVal) {
28
+ return browser.click('#' + forVal.value);
29
+ });
30
+ }
31
+ })
32
+ });
33
+ });
34
+ }
35
+ });
36
+ }
37
+ });
38
+ }
39
+ });
40
+ }
41
+ });
42
+ }
43
+ });
44
+ }
@@ -1,4 +1,3 @@
1
-
2
1
  module.exports.command = function (fileUrl, element) {
3
2
  browser.element('css selector', element, function (result) {
4
3
  if (result.status === 0) {
@@ -0,0 +1,3 @@
1
+ module.exports.command = function (item) {
2
+ return browser.click("[value='" + item + "']");
3
+ }
@@ -0,0 +1,44 @@
1
+ module.exports.command = function (item) {
2
+
3
+ browser.element('css selector', item, function (result) {
4
+ if (result.status === 0) {
5
+ return browser.click(item);
6
+ } else {
7
+ browser.element('css selector', '#' + item, function (result) {
8
+ if (result.status === 0) {
9
+ return browser.click('#' + item);
10
+ } else {
11
+ browser.element('css selector', '.' + item, function (result) {
12
+ if (result.status === 0) {
13
+ return browser.click('.' + item);
14
+ } else {
15
+ browser.element('css selector', 'input[name=' + item + ']', function (result) {
16
+ if (result.status === 0) {
17
+ return browser.click('input[name=' + item + ']');
18
+ } else {
19
+ browser.element('css selector', 'input[value="' + item + '"]', function (result) {
20
+ if (result.status === 0) {
21
+ return browser.click('input[value="' + item + '"]');
22
+ } else {
23
+ browser.elements('css selector', 'label', function (elements) {
24
+ elements.value.forEach(function (elementsObj) {
25
+ browser.elementIdText(elementsObj.ELEMENT, function (result) {
26
+ if (result.value == item) {
27
+ browser.getAttribute(elementsObj, "for", function (forVal) {
28
+ return browser.click('#' + forVal.value);
29
+ });
30
+ }
31
+ })
32
+ });
33
+ });
34
+ }
35
+ });
36
+ }
37
+ });
38
+ }
39
+ });
40
+ }
41
+ });
42
+ }
43
+ });
44
+ }
@@ -0,0 +1,12 @@
1
+ module.exports.command = function (maxof, number, timeType) {
2
+
3
+ var waitTime = number * 1000;
4
+ if(timeType == "m"){
5
+ waitTime = waitTime * 60;
6
+ }
7
+
8
+ if (maxof) {
9
+ return browser.waitForElementPresent('body', waitTime);
10
+ }
11
+ return browser.pause(waitTime);
12
+ }
@@ -17,7 +17,7 @@ module.exports = {
17
17
  options: {
18
18
  feature_path: 'tests/features/*.feature',
19
19
  additional_config: '',
20
- parallel: 2,
20
+ parallel: 1,
21
21
  },
22
22
  },
23
23
 
@@ -76,6 +76,10 @@ module.exports = {
76
76
  'webdriver.chrome.driver': (Services.chromedriver ? Services.chromedriver.path : ''),
77
77
  },
78
78
  },
79
+
80
+ webdriver: {
81
+ start_process: false
82
+ },
79
83
  },
80
84
 
81
85
  'selenium.chrome': {
@@ -83,7 +87,7 @@ module.exports = {
83
87
  desiredCapabilities: {
84
88
  browserName: 'chrome',
85
89
  chromeOptions: {
86
- w3c: true,
90
+ w3c: false,
87
91
  },
88
92
  },
89
93
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webship-js",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Webship JS automated functional testing.",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "engines": {
10
10
  "yarn": ">= 1.6",
11
- "node": ">= 16.0"
11
+ "node": ">= 18.0"
12
12
  },
13
13
  "scripts": {
14
14
  "test": "nightwatch --format @cucumber/pretty-formatter --format-options '{\"colorsEnabled\": true}' --format-options '{\"theme\": {\"feature keyword\":[\"bold\",\"blue\"],\"feature name\":[\"blue\",\"underline\"],\"feature description\":[\"blueBright\"],\"scenario keyword\":[\"bold\",\"magenta\"],\"scenario name\":[\"magenta\",\"underline\"],\"step keyword\":[\"bold\",\"green\"],\"step text\":[\"greenBright\",\"italic\"]}}' --format json:./tests/reports/cucumber_report.json; node generate-reports.js;",
@@ -28,21 +28,21 @@
28
28
  },
29
29
  "homepage": "https://github.com/webship/webship-js",
30
30
  "dependencies": {
31
- "nightwatch": "~2.0",
31
+ "nightwatch": "~3",
32
32
  "@cucumber/cucumber": "*",
33
- "@cucumber/pretty-formatter": "^1.0.0-alpha.2",
34
- "args-parser": "~1.0",
35
- "cucumber-html-reporter": "^7.1.0",
36
- "eslint": "~8.0",
37
- "eslint-config-airbnb-base": "~15.0",
38
- "eslint-plugin-import": "~2.25",
39
- "lodash": "~4.17.21",
40
- "webpack": "~5.0",
33
+ "@cucumber/pretty-formatter": "~1",
34
+ "args-parser": "~1",
35
+ "cucumber-html-reporter": "~7",
36
+ "eslint": "~8",
37
+ "eslint-config-airbnb-base": "~15",
38
+ "eslint-plugin-import": "~2",
39
+ "lodash": "~4",
40
+ "webpack": "~5",
41
41
  "chromedriver": "*",
42
42
  "geckodriver": "*",
43
- "webpack-cli": "~5.0",
44
- "webpack-dev-server": "~4.0",
45
- "request": "~2.0"
43
+ "webpack-cli": "~5",
44
+ "webpack-dev-server": "~4",
45
+ "request": "~2"
46
46
  },
47
47
  "bin": {
48
48
  "steplist": "./steplist.js"
@@ -2,11 +2,15 @@ Feature: An example to test for being on the homepage
2
2
  As an anonymous user
3
3
  I want to be able to navigate to the homepage
4
4
  So that I can check the welcome message at homepage
5
-
6
- Scenario: Check being on the homepage
5
+
6
+ Scenario: Check to be on (the) homepage
7
7
  Given I am on the homepage
8
- Then I should see "Welcome to the homepage of the Webship-js Examples"
8
+ Then I should see "Welcome to the homepage of the Webship-js Examples"
9
9
 
10
- Scenario: Check being on homepage
10
+ Scenario: Check to be on homepage
11
11
  Given I am on homepage
12
- Then I should see "Welcome to the homepage of the Webship-js Examples"
12
+ Then I should see "Welcome to the homepage of the Webship-js Examples"
13
+
14
+ Scenario: Check to be on homepage (useing we)
15
+ Given we are on homepage
16
+ Then we should see "Welcome to the homepage of the Webship-js Examples"
@@ -4,14 +4,14 @@ Feature: An example to test whether an element contains a certain text or not
4
4
 
5
5
  Scenario: Check an element if it contains a specific text
6
6
  Given I am on "/test--then--i-should--not--see-text-in-element.html"
7
- And I fill in "Username" with "user1"
8
- And I fill in "Password" with "1234"
9
- Then I should see "user1" in the "Username" element
10
- When I press "Reset"
11
- And I fill in "Username" with "user2"
12
- Then I should not see "user1" in the "Username" element
7
+ And I fill in "#uname" with "user1"
8
+ And I fill in "#pword" with "1234"
9
+ Then I should see "user1" in the "#uname" element
10
+ When I fill in "#uname" with:
11
+ And I fill in "#pword" with:
12
+ Then I should not see "user1" in the "#uname" element
13
13
 
14
14
  Scenario: Check an element if it does not contain a specific text
15
15
  Given I am on "/test--then--i-should--not--see-text-in-element.html"
16
- And I fill in "Username" with "user2"
17
- Then I should not see "user1" in the "Username" element
16
+ And I fill in "#uname" with "user2"
17
+ Then I should not see "user1" in the "#uname" element
@@ -7,11 +7,6 @@ Scenario: Check if text exist in an element has a pattern match with 12-hour tim
7
7
  And I wait max of 3 seconds
8
8
  Then I should see text matching "(((0[1-9])|(1[0-2])):([0-5])(0|5)\s(A|P|a|p)(M|m))" in the ".time" element
9
9
 
10
- Scenario: Check if text exist in an element has a pattern not match with date YYYY-MM-DD
11
- Given I am on "/test--then--i-should--see-text-matching-pattern.html"
12
- And I wait max of 3 seconds
13
- Then I should not see text matching "\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])" in the "#date" element
14
-
15
10
  Scenario: Check if text exist in an element has a pattern match with date DD/MM/YYYY or DD-MM-YYYY
16
11
  Given I am on "/test--then--i-should--see-text-matching-pattern.html"
17
12
  And I wait max of 3 seconds
@@ -7,4 +7,4 @@ Feature: An example to test being on a specific page
7
7
  When I go to "/about-us.html"
8
8
  Then I should be on "/about-us.html"
9
9
  When I move backward one page
10
- Then I should be on "/"
10
+ Then I should be on homepage
@@ -4,15 +4,15 @@ Feature: An example of test for selecting a checkbox
4
4
 
5
5
  Scenario: Check that the checkbox is checked
6
6
  Given I am on "/test--then--the-checkbox-checked.html"
7
- When I check "rememberMe"
8
- And I check "PrivacyPolicy"
9
- And I press "Register"
10
- Then the checkbox "Remember me" is checked
11
- And I should see "Registration Done Successfully"
7
+ When I check "#rememberMe"
8
+ And I check "#PrivacyPolicy"
9
+ And I press "Register"
10
+ Then the checkbox "#rememberMe" is checked
11
+ And I should see "Registration Done Successfully"
12
12
 
13
13
  Scenario: Check that the checkbox is not checked
14
14
  Given I am on "/test--then--the-checkbox-checked.html"
15
- When I check "PrivacyPolicy"
16
- And I press "Register"
17
- Then the checkbox "Remember me" is not checked
18
- Then I should see "Registration Done Successfully"
15
+ When I check "#PrivacyPolicy"
16
+ And I press "Register"
17
+ Then the checkbox "#rememberMe" is not checked
18
+ Then I should see "Registration Done Successfully"
@@ -4,13 +4,13 @@ Feature: An example of test assert for selecting a checkbox
4
4
 
5
5
  Scenario: Check that the checkbox should be checked
6
6
  Given I am on "/test--then--the-checkbox-checked.html"
7
- When I check "PrivacyPolicy"
7
+ When I check "#PrivacyPolicy"
8
8
  And I press "Register"
9
- Then the checkbox "PrivacyPolicy" should be checked
9
+ Then the checkbox "#PrivacyPolicy" should be checked
10
10
  And I should see "Registration Done Successfully"
11
11
 
12
12
  Scenario: Check that the checkbox should not be checked
13
13
  Given I am on "/test--then--the-checkbox-checked.html"
14
14
  When I press "Register"
15
- Then the "PrivacyPolicy" checkbox should not be checked
15
+ Then the "#PrivacyPolicy" checkbox should not be checked
16
16
  And I should see "Please check Agree to Privacy Policy"
@@ -6,10 +6,10 @@ Feature: An example to test if the element contains a certain expected CSS prope
6
6
  Given I am on "/test--then--the-element-should_not-contain-cssproperty.html"
7
7
  Then I should see a "body" element
8
8
  When I press "Submit"
9
- Then the "body" element should contain "background-color: white;"
9
+ Then the "body" element should contain "background-color:white;"
10
10
 
11
11
  Scenario: Check element if the element not contains a certain CSS property
12
12
  Given I am on "/test--then--the-element-should_not-contain-cssproperty.html"
13
13
  Then I should see a "body" element
14
14
  When I press "Submit"
15
- Then the "Username" element should not contain "border: solid 5px red;"
15
+ Then the "#uname" element should not contain "border:solid 5px red;"
@@ -4,8 +4,8 @@ Feature: An example to test if the field contains certain value
4
4
 
5
5
  Scenario: Check field if has a particular value or not
6
6
  Given I am on "/test--then--i-should--not--see-text-in-element.html"
7
- And I fill in "Username" with "user1"
8
- Then the "Username" field should contain "user1"
7
+ And I fill in "#uname" with "user1"
8
+ Then the "#uname" field should contain "user1"
9
9
  When I press "Reset"
10
- And I fill in "Username" with "user2"
11
- Then the "Username" field should not contain "user1"
10
+ And I fill in "#uname" with "user2"
11
+ Then the "#uname" field should not contain "user1"
@@ -5,27 +5,27 @@ Feature: An example to test a page response status code
5
5
  Scenario: Check the response status code for not existing page page
6
6
  Given I am on the homepage
7
7
  When I go to "/not-existing-page.html"
8
- And I wait 2 seconds
8
+ And I wait max of 2 seconds
9
9
  Then the response status code should be 404
10
10
  And the response status code should not be 200
11
11
 
12
12
  Scenario: Check the response status code for existing page
13
13
  Given I am on the homepage
14
14
  When I go to "/existing-page.html"
15
- And I wait 2 seconds
15
+ And I wait max of 2 seconds
16
16
  Then the response status code should not be 404
17
17
  And the response status code should be 200
18
18
 
19
19
  Scenario: Check the response status code for an API with JSON page format
20
20
  Given I am on the homepage
21
21
  When I go to "/example-api.json"
22
- And I wait 2 seconds
22
+ And I wait max of 2 seconds
23
23
  Then the response status code should not be 404
24
24
  And the response status code should be 200
25
25
 
26
26
  Scenario: Check the response status code for a parameter of the API with JSON page format
27
27
  Given I am on the homepage
28
28
  When I go to "/example-api.json?include=author"
29
- And I wait 2 seconds
29
+ And I wait max of 2 seconds
30
30
  Then the response status code should not be 404
31
31
  And the response status code should be 200
@@ -0,0 +1,7 @@
1
+ Feature: An example of testing for matching URLs for a particular expression
2
+ As a tester
3
+ I want to be able to be sure that current page PATH matches regular expression
4
+
5
+ Scenario: Check the current page path matchs URL expression with dashes between words
6
+ Given I am on "/test-acceptable-url-path.html"
7
+ Then the url should match "(https?:\/\/)?([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^?#\s_]+)?(\?[^#\s_]+)?(#.*)?"
@@ -3,8 +3,8 @@ Feature: An example to test attach file to field
3
3
  As a tester
4
4
  I want to be able to attach file (images) to field
5
5
 
6
- Scenario: Check attach file to field
7
- Given I am on "/test--when--i-attach-file-to-feild.html"
8
- When I attach the file "webshipco.png" to "#fileUpload"
9
- When I press "Submit"
10
- Then I should see "webshipco.png"
6
+ # Scenario: Check attach file to field
7
+ # Given I am on "/test--when--i-attach-file-to-feild.html"
8
+ # When I attach the file "webshipco.png" to "#fileUpload"
9
+ # When I press "Submit"
10
+ # Then I should see "webshipco.png"
@@ -1,17 +1,21 @@
1
- Feature: An example to check the checkbox
1
+ Feature: An example to uncheck the checkbox
2
2
 
3
3
  As a tester
4
- I want to be able to check a checkbox
4
+ I want to be able to uncheck a checkbox
5
5
 
6
- Scenario: Check the checkbox
6
+ Scenario: Uncheck the checkbox
7
7
  Given I am on "/test--when--i-check-uncheck-checkbox.html"
8
- When I check "vehicle1"
9
- And I press "Submit"
10
- Then I should see "You have a Bike"
11
- When I check "Car"
8
+ When I check "#bike"
9
+ And I check "#car"
12
10
  And I press "Submit"
13
11
  Then I should see "You have a Bike Car"
14
- When I check "I have a boat"
12
+ When I check ".van"
13
+ Then I should see "You have a Bike Car Van"
14
+ When I uncheck "#bike"
15
+ And I press "Submit"
16
+ Then I should see "You have a Car Van"
17
+ When I uncheck "#car"
18
+ When I uncheck "#van"
15
19
  And I press "Submit"
16
- Then I should see "You have a Bike Car Boat"
20
+ Then I should see "You have a"
17
21
 
@@ -5,12 +5,12 @@ Feature: An example to click link
5
5
 
6
6
  Scenario: Check click link by link text
7
7
  Given I am on "/test--when--i-click-link.html"
8
- When I click "About us link"
8
+ When I click "#aboutUsid"
9
9
  And I wait max of 2 seconds
10
10
  Then I should see "About Us"
11
11
 
12
12
  Scenario: Check click link by link css class
13
13
  Given I am on "/test--when--i-click-link.html"
14
- When I click "aboutUs"
14
+ When I click ".aboutUs"
15
15
  And I wait max of 2 seconds
16
16
  Then I should see "About Us"
@@ -4,28 +4,28 @@ I want to be able to fill input text with value
4
4
 
5
5
  Scenario: Check fill in input field with value
6
6
  Given I am on "/test--when--i-fill-in.html"
7
- When I fill in "Username" with "John Smith"
8
- When I fill in "Password" with "1234"
7
+ When I fill in "#uname" with "John Smith"
8
+ When I fill in "#pword" with "1234"
9
9
  When I press "Login"
10
- Then I should see "You enter Username: John Smith and Password: 1234"
10
+ Then I should see "You enter #uname: John Smith and Password: 1234"
11
11
 
12
12
  Scenario: Check fill in input field with empty value
13
13
  Given I am on "/test--when--i-fill-in.html"
14
- When I fill in "Username" with:
14
+ When I fill in "#uname" with:
15
15
  When I press "Login"
16
16
  Then I should see "You enter Username: "
17
17
 
18
18
  Scenario: Check fill in value for input field
19
19
  Given I am on "/test--when--i-fill-in.html"
20
- When I fill in "John Smith" for "Username"
21
- When I fill in "1234" for "Password"
20
+ When I fill in "John Smith" for "#uname"
21
+ When I fill in "1234" for "#pword"
22
22
  When I press "Login"
23
23
  Then I should see "You enter Username: John Smith and Password: 1234"
24
24
 
25
25
  Scenario: Check fill in table of input fields
26
26
  Given I am on "/test--when--i-fill-in.html"
27
27
  When I fill in the following:
28
- | username | John Smith |
29
- | password | 1234 |
28
+ | #uname | John Smith |
29
+ | #pword | 1234 |
30
30
  When I press "Login"
31
31
  Then I should see "You enter Username: John Smith and Password: 1234"
@@ -0,0 +1,10 @@
1
+ Feature: An example to test for being on any page and go to homepage
2
+ As an anonymous user
3
+ I want to be able to navigate to the homepage from another page, So that I can check the welcome message at homepage
4
+
5
+ Scenario: Check to be on (the) About Us page then go to home page
6
+ Given I am on "/about-us.html"
7
+ When I go to the homepage
8
+ Then I should see "Welcome to the homepage of the Webship-js Examples"
9
+
10
+
@@ -8,8 +8,8 @@ I want to be able to navigate forward and backward one page
8
8
  When I go to "/about-us.html"
9
9
  Then I should see "About Us"
10
10
  When I move backward one page
11
- And I wait max of 3 seconds
11
+ And I wait max of 3 seconds
12
12
  Then I should see "Welcome to the homepage of the Webship-js Examples"
13
13
  When I move forward one page
14
- And I wait max of 3 seconds
14
+ And I wait max of 3 seconds
15
15
  Then I should see "About Us"
@@ -5,7 +5,7 @@ Feature: An example to select option from drop down list
5
5
 
6
6
  Scenario: Check of selecting option from drop down list
7
7
  Given I am on "/test--when--i-select-option-from-dropdownlist.html"
8
- When I select "saab" from "cars"
8
+ When I select "saab" from "#cars"
9
9
  When I press "Check select"
10
10
  Then I should see "Option ( Saab ) has been selected successfully"
11
11