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.
- package/.github/workflows/github-actions.yml +25 -9
- package/README.md +4 -7
- package/assets/config_templates/circleci-linux-chrome.conf.js +8 -3
- package/bitbucket-pipelines.yml +1 -1
- package/examples/test--then--i-should--see-text-in-element.html +48 -0
- package/examples/test--when--i-check-uncheck-checkbox.html +5 -3
- package/lib/custom-assertions/checkboxChecked.js +33 -0
- package/lib/custom-assertions/elementContainsCss.js +32 -0
- package/lib/custom-assertions/elementContainsText.js +32 -0
- package/lib/custom-assertions/responseStatus.js +1 -1
- package/lib/custom-assertions/shouldVisible.js +1 -1
- package/lib/custom-assertions/textMatching.js +32 -0
- package/lib/custom-commands/checkItem.js +21 -16
- package/lib/custom-commands/uncheckItem.js +21 -16
- package/nightwatch.conf.js +5 -1
- package/package.json +14 -14
- package/tests/features/test--then--i-should--not--see-text-in-element.feature +8 -8
- package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +0 -5
- package/tests/features/test--then--the-checkbox-is-checked.feature +9 -9
- package/tests/features/test--then--the-checkbox-should-be-checked.feature +3 -3
- package/tests/features/test--then--the-element-should_not-contain-cssproperty.feature +2 -2
- package/tests/features/test--then--the-field-should-contain-value.feature +4 -4
- package/tests/features/test--then--the-response-status-code-should-be.feature +4 -4
- package/tests/features/test--when--i-attach-file-to-feild.feature +5 -5
- package/tests/features/test--when--i-check-checkbox.feature +13 -9
- package/tests/features/test--when--i-click-link.feature +2 -2
- package/tests/features/test--when--i-fill-in.feature +8 -8
- package/tests/features/test--when--i-go-to-homepage.feature +10 -0
- package/tests/features/test--when--i-move-forward-backward-one-page.feature +2 -2
- package/tests/features/test--when--i-select-option-from-dropdownlist.feature +1 -1
- package/tests/step-definitions/webship.js +381 -102
- package/lib/custom-assertions/backToHomepage.js +0 -15
- 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 "
|
|
8
|
-
Then the "
|
|
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 "
|
|
11
|
-
Then the "
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
1
|
+
Feature: An example to uncheck the checkbox
|
|
2
2
|
|
|
3
3
|
As a tester
|
|
4
|
-
I want to be able to
|
|
4
|
+
I want to be able to uncheck a checkbox
|
|
5
5
|
|
|
6
|
-
Scenario:
|
|
6
|
+
Scenario: Uncheck the checkbox
|
|
7
7
|
Given I am on "/test--when--i-check-uncheck-checkbox.html"
|
|
8
|
-
When I check "
|
|
9
|
-
And I
|
|
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 "
|
|
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
|
|
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 "
|
|
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 "
|
|
8
|
-
When I fill in "
|
|
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
|
|
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 "
|
|
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 "
|
|
21
|
-
When I fill in "1234" for "
|
|
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
|
-
|
|
|
29
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|