webship-js 1.0.23 → 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 (33) hide show
  1. package/.github/workflows/github-actions.yml +25 -9
  2. package/README.md +4 -7
  3. package/assets/config_templates/circleci-linux-chrome.conf.js +8 -3
  4. package/bitbucket-pipelines.yml +1 -1
  5. package/examples/test--then--i-should--see-text-in-element.html +48 -0
  6. package/examples/test--when--i-check-uncheck-checkbox.html +5 -3
  7. package/lib/custom-assertions/checkboxChecked.js +33 -0
  8. package/lib/custom-assertions/elementContainsCss.js +32 -0
  9. package/lib/custom-assertions/elementContainsText.js +32 -0
  10. package/lib/custom-assertions/responseStatus.js +1 -1
  11. package/lib/custom-assertions/shouldVisible.js +1 -1
  12. package/lib/custom-assertions/textMatching.js +32 -0
  13. package/lib/custom-commands/checkItem.js +21 -16
  14. package/lib/custom-commands/uncheckItem.js +21 -16
  15. package/nightwatch.conf.js +5 -1
  16. package/package.json +14 -14
  17. package/tests/features/test--then--i-should--not--see-text-in-element.feature +8 -8
  18. package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +0 -5
  19. package/tests/features/test--then--the-checkbox-is-checked.feature +9 -9
  20. package/tests/features/test--then--the-checkbox-should-be-checked.feature +3 -3
  21. package/tests/features/test--then--the-element-should_not-contain-cssproperty.feature +2 -2
  22. package/tests/features/test--then--the-field-should-contain-value.feature +4 -4
  23. package/tests/features/test--then--the-response-status-code-should-be.feature +4 -4
  24. package/tests/features/test--when--i-attach-file-to-feild.feature +5 -5
  25. package/tests/features/test--when--i-check-checkbox.feature +13 -9
  26. package/tests/features/test--when--i-click-link.feature +2 -2
  27. package/tests/features/test--when--i-fill-in.feature +8 -8
  28. package/tests/features/test--when--i-go-to-homepage.feature +10 -0
  29. package/tests/features/test--when--i-move-forward-backward-one-page.feature +2 -2
  30. package/tests/features/test--when--i-select-option-from-dropdownlist.feature +1 -1
  31. package/tests/step-definitions/webship.js +381 -102
  32. package/lib/custom-assertions/backToHomepage.js +0 -15
  33. package/tests/features/test--when--i-uncheck-checkbox.feature +0 -18
@@ -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
@@ -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