webship-js 1.0.30 → 1.0.32
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/.circleci/config.yml +1 -1
- package/.github/workflows/github-actions.yml +42 -18
- package/.gitlab-ci.yml +43 -32
- package/assets/config_templates/circleci-linux-chrome.conf.js +1 -1
- package/assets/config_templates/github-linux-chrome.conf.js +1 -1
- package/examples/test--then--i-should--not--see-text-in-element.html +2 -2
- package/examples/test--then--i-should--see-text-in-element.html +2 -2
- package/examples/test--then--the-element-should_not-contain-cssproperty.html +2 -2
- package/examples/test--when--i-fill-in.html +4 -4
- package/examples/test--when--i-press-button.html +5 -2
- package/examples/test--when--i-select-option-from-dropdownlist.html +1 -1
- package/nightwatch.conf.js +2 -2
- package/package.json +1 -1
- package/tests/features/test--then--i-should--not--see-text-in-element.feature +9 -14
- package/tests/features/test--then--i-should--see-text-in-element-by-attr.feature +10 -0
- package/tests/features/test--then--i-should--see-text-in-element.feature +10 -0
- package/tests/features/test--then--i-should-not-see-an-element-by-attr.feature +8 -0
- package/tests/features/test--then--i-should-not-see-an-element.feature +8 -0
- package/tests/features/test--then--i-should-see-an-element-by-attr.feature +8 -0
- package/tests/features/test--then--i-should-see-an-element.feature +6 -6
- package/tests/features/test--then--the-checkbox-is-checked.feature +2 -2
- package/tests/features/test--then--the-checkbox-should-be-checked.feature +2 -2
- package/tests/features/{test--then--the-element-should_not-contain-cssproperty.feature → test--then--the-element-should-contain-cssproperty.feature} +4 -10
- package/tests/features/test--then--the-element-should-not-contain-cssproperty.feature +10 -0
- package/tests/features/test--then--the-field-should-contain-value.feature +3 -3
- package/tests/features/test--when--i-attach-file-to-feild.feature +1 -1
- package/tests/features/test--when--i-check-checkbox.feature +4 -4
- package/tests/features/test--when--i-click-link-by-attribute.feature +22 -0
- package/tests/features/test--when--i-fill-in-by-attr.feature +31 -0
- package/tests/features/test--when--i-fill-in-table-by-attr.feature +19 -0
- package/tests/features/test--when--i-fill-in.feature +13 -12
- package/tests/features/test--when--i-press-button-by-attribute.feature +15 -0
- package/tests/features/test--when--i-press-button.feature +2 -2
- package/tests/features/test--when--i-reload-page.feature +1 -1
- package/tests/features/test--when--i-select-option-from-dropdownlist-by-attr.feature +16 -0
- package/tests/features/test--when--i-select-option-from-dropdownlist.feature +6 -8
- package/tests/step-definitions/webship.js +418 -55
package/.circleci/config.yml
CHANGED
|
@@ -44,7 +44,7 @@ commands:
|
|
|
44
44
|
sudo apt-get install libappindicator1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils
|
|
45
45
|
export CHROME_BIN=/usr/bin/google-chrome
|
|
46
46
|
CHROME_VERSION="115.0.5790.110-1"
|
|
47
|
-
wget https://
|
|
47
|
+
wget https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
48
48
|
sudo dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
49
49
|
rm google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
50
50
|
|
|
@@ -4,38 +4,62 @@ on: [push]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
|
-
|
|
8
7
|
runs-on: ubuntu-latest
|
|
9
8
|
|
|
10
9
|
env:
|
|
11
10
|
TEST_BASE_URL: http://localhost:8080
|
|
12
|
-
SELENIUM_HOST: http://
|
|
11
|
+
SELENIUM_HOST: http://localhost:4444/wd/hub
|
|
13
12
|
|
|
14
13
|
steps:
|
|
15
|
-
- name: Install Chrome
|
|
14
|
+
- name: Install/Update Google Chrome browser
|
|
15
|
+
run: |
|
|
16
|
+
sudo apt install libu2f-udev
|
|
17
|
+
sudo apt-get install libappindicator1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils
|
|
18
|
+
export CHROME_BIN=/usr/bin/google-chrome
|
|
19
|
+
CHROME_VERSION="115.0.5790.110-1"
|
|
20
|
+
wget https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
21
|
+
sudo dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
22
|
+
rm google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
23
|
+
|
|
24
|
+
- name: Install/Update Chrome Driver
|
|
16
25
|
run: |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
CHROME_DRIVER_VERSION=114.0.5735.90;
|
|
27
|
+
echo $CHROME_DRIVER_VERSION;
|
|
28
|
+
wget http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip
|
|
29
|
+
unzip chromedriver_linux64.zip
|
|
30
|
+
sudo chmod +x chromedriver
|
|
31
|
+
sudo mv -f chromedriver /usr/bin/
|
|
32
|
+
rm chromedriver_linux64.zip
|
|
33
|
+
|
|
34
|
+
- name: Checkout repository
|
|
35
|
+
uses: actions/checkout@v3
|
|
36
|
+
|
|
37
|
+
- name: Set up Node.js
|
|
23
38
|
uses: actions/setup-node@v3
|
|
24
39
|
with:
|
|
25
40
|
node-version: '18.x'
|
|
26
41
|
|
|
42
|
+
- name: Install Java
|
|
43
|
+
run: |
|
|
44
|
+
sudo apt update
|
|
45
|
+
sudo apt install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
|
|
46
|
+
|
|
27
47
|
- name: Run Selenium Standalone server
|
|
28
48
|
run: |
|
|
29
|
-
wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.
|
|
30
|
-
java -jar selenium-server-4.
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar
|
|
50
|
+
nohup java -jar selenium-server-4.4.0.jar standalone > selenium.log 2>&1 &
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
- name: Install dependencies
|
|
33
54
|
run: yarn install
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
|
|
56
|
+
- name: Configure nightwatch.conf.js for GitHub
|
|
57
|
+
run: node webship-init -ci circleci -os linux -b chrome
|
|
58
|
+
|
|
36
59
|
- name: Start virtual server
|
|
37
60
|
run: |
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
61
|
+
export NODE_OPTIONS=--openssl-legacy-provider
|
|
62
|
+
yarn start &
|
|
63
|
+
|
|
64
|
+
- name: Run tests
|
|
41
65
|
run: yarn test
|
package/.gitlab-ci.yml
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
|
-
image:
|
|
1
|
+
image: cimg/base:stable-20.04
|
|
2
2
|
|
|
3
|
+
services:
|
|
4
|
+
- name: selenium/standalone-chrome
|
|
5
|
+
alias: selenium
|
|
6
|
+
|
|
7
|
+
variables:
|
|
8
|
+
CHROME_VERSION: "115.0.5790.110-1"
|
|
9
|
+
CHROME_DRIVER_VERSION: "114.0.5735.90"
|
|
10
|
+
NODE_OPTIONS: "--openssl-legacy-provider"
|
|
11
|
+
|
|
12
|
+
before_script:
|
|
13
|
+
- sudo apt-get update -qq
|
|
14
|
+
- sudo apt-get upgrade -qqy
|
|
15
|
+
- sudo apt-get install -yqq vim links lynx git diffutils htop curl wget p7zip-full unzip zip sed gcc g++ make libfreetype6-dev libaio1 libaio-dev libonig-dev libpng-dev
|
|
16
|
+
- sudo apt-get install -yqq xvfb libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3.0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 libnss3
|
|
17
|
+
- curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
|
|
18
|
+
- sudo apt-get install -y nodejs
|
|
19
|
+
- sudo npm install -g yarn
|
|
20
|
+
- sudo apt-get update
|
|
21
|
+
- sudo apt-get install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
|
|
22
|
+
- sudo apt-get install -y libu2f-udev
|
|
23
|
+
- sudo apt-get install -y libappindicator1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils
|
|
24
|
+
- wget https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
25
|
+
- sudo dpkg -i google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
26
|
+
- rm google-chrome-stable_${CHROME_VERSION}_amd64.deb
|
|
27
|
+
- wget http://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip
|
|
28
|
+
- unzip chromedriver_linux64.zip
|
|
29
|
+
- sudo chmod +x chromedriver
|
|
30
|
+
- sudo mv chromedriver /usr/bin/
|
|
31
|
+
- rm chromedriver_linux64.zip
|
|
32
|
+
|
|
3
33
|
stages:
|
|
4
|
-
-
|
|
34
|
+
- build
|
|
5
35
|
- test
|
|
6
36
|
|
|
7
|
-
|
|
8
|
-
stage:
|
|
37
|
+
webship-js-build:
|
|
38
|
+
stage: build
|
|
9
39
|
script:
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
- apt-get install -y nodejs yarn
|
|
13
|
-
|
|
14
|
-
# Install Google Chrome and Chromedriver
|
|
15
|
-
- apt-get install -y wget unzip
|
|
16
|
-
- wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
17
|
-
- dpkg -i google-chrome*.deb
|
|
18
|
-
- apt-get -f install -y
|
|
19
|
-
- CHROMEDRIVER_VERSION=$(curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE)
|
|
20
|
-
- wget -q https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip
|
|
21
|
-
- unzip chromedriver_linux64.zip
|
|
22
|
-
- mv chromedriver /usr/local/bin/
|
|
23
|
-
- chmod +x /usr/local/bin/chromedriver
|
|
24
|
-
|
|
25
|
-
# Install dependencies and run Webpack
|
|
40
|
+
- wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar
|
|
41
|
+
- nohup java -jar selenium-server-4.4.0.jar standalone > selenium.log 2>&1 &
|
|
26
42
|
- yarn install
|
|
27
|
-
-
|
|
43
|
+
- node webship-init -ci circleci -os linux -b chrome
|
|
44
|
+
- export NODE_OPTIONS=--openssl-legacy-provider
|
|
45
|
+
- yarn start &
|
|
28
46
|
- yarn test
|
|
29
47
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
when: always
|
|
35
|
-
paths:
|
|
36
|
-
- selenium/
|
|
37
|
-
variables:
|
|
38
|
-
SELENIUM_REMOTE_URL: http://localhost:8080
|
|
39
|
-
GITLAB_TARGET_SELENIUM_REMOTE_URL: http://localhost:4444/wd/hub
|
|
40
|
-
|
|
48
|
+
only:
|
|
49
|
+
refs:
|
|
50
|
+
- tags
|
|
51
|
+
- branches
|
|
@@ -38,7 +38,7 @@ module.exports = {
|
|
|
38
38
|
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
|
|
39
39
|
//
|
|
40
40
|
// w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
|
|
41
|
-
w3c:
|
|
41
|
+
w3c: true,
|
|
42
42
|
args: [
|
|
43
43
|
'--headless',
|
|
44
44
|
'--start-maximized',
|
|
@@ -48,7 +48,7 @@ module.exports = {
|
|
|
48
48
|
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
|
|
49
49
|
//
|
|
50
50
|
// w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
|
|
51
|
-
w3c:
|
|
51
|
+
w3c: true,
|
|
52
52
|
args: [
|
|
53
53
|
'--headless',
|
|
54
54
|
'--start-maximized',
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
<h1>Login</h1>
|
|
33
33
|
|
|
34
34
|
<div class="container">
|
|
35
|
-
<p><label for="uname"
|
|
35
|
+
<p><label for="uname">Username</label></p>
|
|
36
36
|
<p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
|
|
37
37
|
|
|
38
|
-
<p><label for="pword"
|
|
38
|
+
<p><label for="pword">Password</label></p>
|
|
39
39
|
<p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
|
|
40
40
|
|
|
41
41
|
<p><input id="reset" type="reset" value="Reset" /><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()" /></p>
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
<h1>Login</h1>
|
|
33
33
|
|
|
34
34
|
<div class="container">
|
|
35
|
-
<p><label for="uname"
|
|
35
|
+
<p><label for="uname">Username</label></p>
|
|
36
36
|
<p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
|
|
37
37
|
|
|
38
|
-
<p><label for="pword"
|
|
38
|
+
<p><label for="pword">Password</label></p>
|
|
39
39
|
<p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
|
|
40
40
|
|
|
41
41
|
<p><input id="reset" type="reset" value="Reset" /><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()" /></p>
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
<h1>Login</h1>
|
|
32
32
|
|
|
33
33
|
<div class="container">
|
|
34
|
-
<p><label for="uname"
|
|
34
|
+
<p><label for="uname">Username</label></p>
|
|
35
35
|
<p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
|
|
36
36
|
|
|
37
|
-
<p><label for="pword"
|
|
37
|
+
<p><label for="pword">Password</label></p>
|
|
38
38
|
<p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
|
|
39
39
|
|
|
40
40
|
<p><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Submit" onclick="onClick()"></p>
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
<h1>Login</h1>
|
|
33
33
|
|
|
34
34
|
<div class="container">
|
|
35
|
-
<p><label for="uname"
|
|
36
|
-
<p><input id="uname" class="unamecss" type="text" placeholder="
|
|
35
|
+
<p><label for="uname">Username</label></p>
|
|
36
|
+
<p><input id="uname" class="unamecss" type="text" placeholder="Your full name" name="username"></p>
|
|
37
37
|
|
|
38
|
-
<p><label for="pword"
|
|
39
|
-
<p><input id="pword" class="pwordcss" type="password" placeholder="
|
|
38
|
+
<p><label for="pword">Password</label></p>
|
|
39
|
+
<p><input id="pword" class="pwordcss" type="password" placeholder="Your Password" name="password"></p>
|
|
40
40
|
|
|
41
41
|
<p><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()"></p>
|
|
42
42
|
|
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
<body>
|
|
23
23
|
<h1>Press Button</h1>
|
|
24
24
|
<div id="result" class="style"></div><br/>
|
|
25
|
-
<label for="
|
|
26
|
-
<
|
|
25
|
+
<label for="btn-pressid">Press button</label>
|
|
26
|
+
<button id="btn-pressid" class="btn-pressclass" name="btn-pressname" onclick="onClick()">Button</button>
|
|
27
|
+
|
|
28
|
+
<input type="submit" id="submit-pressid" class="submit-pressclass" name="submit-pressname" value="Submit" onclick="onClick()" />
|
|
29
|
+
|
|
27
30
|
</body>
|
|
28
31
|
</html>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<option value="mercedes">Mercedes</option>
|
|
30
30
|
<option value="audi">Audi</option>
|
|
31
31
|
</select>
|
|
32
|
-
<input id="btnClick" class="btnClick" name="btnClick" type="button" value="
|
|
32
|
+
<input id="btnClick" class="btnClick" name="btnClick" type="button" value="Submit" onclick="onClick()">
|
|
33
33
|
<div id="result" class="style"></div><br/>
|
|
34
34
|
</body>
|
|
35
35
|
</html>
|
package/nightwatch.conf.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const Services = {}; loadServices();
|
|
2
|
-
require('events').EventEmitter.defaultMaxListeners =
|
|
2
|
+
require('events').EventEmitter.defaultMaxListeners = 1000;
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
5
|
// An array of folders (excluding subfolders) where your tests are located;
|
|
@@ -38,7 +38,7 @@ module.exports = {
|
|
|
38
38
|
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
|
|
39
39
|
//
|
|
40
40
|
// w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
|
|
41
|
-
w3c:
|
|
41
|
+
w3c: true,
|
|
42
42
|
args: [
|
|
43
43
|
'--headless',
|
|
44
44
|
'--start-maximized',
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
Feature: An example to test whether
|
|
1
|
+
Feature: An example to test whether the input text does not contain a specific value by its attribute
|
|
2
2
|
As a tester
|
|
3
|
-
I want to be able to check an
|
|
4
|
-
|
|
5
|
-
Scenario: Check an element if it contains a specific text
|
|
6
|
-
Given I am on "/test--then--i-should--not--see-text-in-element.html"
|
|
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
|
-
|
|
3
|
+
I want to be able to check an input text does not contain a specific value by its attribute
|
|
14
4
|
Scenario: Check an element if it does not contain a specific text
|
|
15
5
|
Given I am on "/test--then--i-should--not--see-text-in-element.html"
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
When I fill in "Username" with "user1"
|
|
7
|
+
And I fill in "Password" with "1234"
|
|
8
|
+
Then I should see "user1" in the "Username" element
|
|
9
|
+
When I fill in "uname" with: by attr
|
|
10
|
+
And I fill in "Password" with:
|
|
11
|
+
Then I should not see "user1" in the "Username" element
|
|
12
|
+
Then I should not see "1234" in the "pword" element by attr
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: An example to test whether an element contains a certain text or not
|
|
2
|
+
As a tester
|
|
3
|
+
I want to be able to check an element contains a certain text or not
|
|
4
|
+
|
|
5
|
+
Scenario: Check an element if it contains a specific text
|
|
6
|
+
Given I am on "/test--then--i-should--not--see-text-in-element.html"
|
|
7
|
+
When I fill in "Username" with "user1"
|
|
8
|
+
And I fill in "Password" with "1234"
|
|
9
|
+
Then I should see "user1" in the "uname" element by its "id" attr
|
|
10
|
+
And I should see "1234" in the "pwordcss" element by attr
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: An example to test whether an input text contains a certain text by its label
|
|
2
|
+
As a tester
|
|
3
|
+
I want to be able to check an element contains a certain text or not
|
|
4
|
+
|
|
5
|
+
Scenario: Check an element if it contains a specific text
|
|
6
|
+
Given I am on "/test--then--i-should--not--see-text-in-element.html"
|
|
7
|
+
When 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
|
+
And I should see "1234" in the "Password" element
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Feature: An example to test not seeing for a specific element on current page by its label
|
|
2
|
+
As a user
|
|
3
|
+
I want to make sure that when I'm on a particular page, I should not see a specific element by its label
|
|
4
|
+
|
|
5
|
+
Scenario: Check to test not seeing for a specific element by its label
|
|
6
|
+
Given I am on "/test--then--i-should--see-text-in-element.html"
|
|
7
|
+
Then I should not see an "emailId" element by its "id" attr
|
|
8
|
+
And I should not see a "countryCss" element by attr
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Feature: An example to test not seeing for a specific element on current page by its label
|
|
2
|
+
As a user
|
|
3
|
+
I want to make sure that when I'm on a particular page, I should not see a specific element by its label
|
|
4
|
+
|
|
5
|
+
Scenario: Check to test not seeing for a specific element by its label
|
|
6
|
+
Given I am on "/test--then--i-should--see-text-in-element.html"
|
|
7
|
+
Then I should not see an "Eamil" element
|
|
8
|
+
And I should not see a "Country" element
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Feature: An example to test seeing for a specific element on current page by its attributes
|
|
2
|
+
As a user
|
|
3
|
+
I want to make sure that when I'm on a particular page, I should see a specific element by its attributes
|
|
4
|
+
|
|
5
|
+
Scenario: Check to test seeing for a specific element by its attributes
|
|
6
|
+
Given I am on "/test--then--i-should--see-text-in-element.html"
|
|
7
|
+
Then I should see a "uname" element by its "id" attr
|
|
8
|
+
And I should see a "pwordcss" element by attr
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Feature: An example to test seeing for a specific element on current page
|
|
1
|
+
Feature: An example to test seeing for a specific element on current page by its label
|
|
2
2
|
As a user
|
|
3
|
-
I want to make sure that when I'm on a particular page, I should see a specific element
|
|
3
|
+
I want to make sure that when I'm on a particular page, I should see a specific element by its label
|
|
4
4
|
|
|
5
|
-
Scenario: Check to test seeing for a specific element
|
|
6
|
-
Given I am on "/
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Scenario: Check to test seeing for a specific element by its label
|
|
6
|
+
Given I am on "/test--then--i-should--see-text-in-element.html"
|
|
7
|
+
Then I should see a "Username" element
|
|
8
|
+
And I should see a "Password" element
|
|
@@ -6,13 +6,13 @@ Feature: An example of test for selecting a checkbox
|
|
|
6
6
|
Given I am on "/test--then--the-checkbox-checked.html"
|
|
7
7
|
When I check "rememberMe"
|
|
8
8
|
And I check "PrivacyPolicy"
|
|
9
|
-
And I press "Register"
|
|
9
|
+
And I press "Register" by attr
|
|
10
10
|
Then the checkbox "#rememberMe" is checked
|
|
11
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
15
|
When I check "PrivacyPolicy"
|
|
16
|
-
And I press "Register"
|
|
16
|
+
And I press "Register" by attr
|
|
17
17
|
Then the checkbox "#rememberMe" is not checked
|
|
18
18
|
Then I should see "Registration Done Successfully"
|
|
@@ -5,12 +5,12 @@ Feature: An example of test assert for selecting a checkbox
|
|
|
5
5
|
Scenario: Check that the checkbox should be checked
|
|
6
6
|
Given I am on "/test--then--the-checkbox-checked.html"
|
|
7
7
|
When I check "PrivacyPolicy"
|
|
8
|
-
And I press "Register"
|
|
8
|
+
And I press "Register" by attr
|
|
9
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
|
-
When I press "Register"
|
|
14
|
+
When I press "Register" by attr
|
|
15
15
|
Then the "#PrivacyPolicy" checkbox should not be checked
|
|
16
16
|
And I should see "Please check Agree to Privacy Policy"
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
Feature: An example to test if the element contains a certain expected CSS property
|
|
1
|
+
Feature: An example to test if the element contains a certain expected CSS property.
|
|
2
2
|
As a developer
|
|
3
|
-
I want to be able to test if the element contains a certain expected CSS property
|
|
3
|
+
I want to be able to test if the element contains a certain expected CSS property.
|
|
4
4
|
|
|
5
5
|
Scenario: Check element if the element contains a certain expected CSS property
|
|
6
6
|
Given I am on "/test--then--the-element-should_not-contain-cssproperty.html"
|
|
7
|
-
Then I should see a "body" element
|
|
7
|
+
Then I should see a "body" element by attr
|
|
8
8
|
When I press "Submit"
|
|
9
|
-
Then the "body" element should contain "background-color:white;"
|
|
10
|
-
|
|
11
|
-
Scenario: Check element if the element not contains a certain CSS property
|
|
12
|
-
Given I am on "/test--then--the-element-should_not-contain-cssproperty.html"
|
|
13
|
-
Then I should see a "body" element
|
|
14
|
-
When I press "Submit"
|
|
15
|
-
Then the "#uname" element should not contain "border:solid 5px red;"
|
|
9
|
+
Then the "body" element should contain "background-color:white;" css style
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: An example to test if the element does not contain a certain expected CSS property.
|
|
2
|
+
As a developer
|
|
3
|
+
I want to be able to test if the element does not contain a certain expected CSS property.
|
|
4
|
+
|
|
5
|
+
Scenario: Check element if the element not contain a certain CSS property
|
|
6
|
+
Given I am on "/test--then--the-element-should_not-contain-cssproperty.html"
|
|
7
|
+
Then I should see a "body" element by attr
|
|
8
|
+
When I press "Submit"
|
|
9
|
+
Then the "#uname" element should not contain "border:solid 5px red;" css style
|
|
10
|
+
And the "pword" element should not contain "font-size: 28px;" css style
|
|
@@ -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 "
|
|
7
|
+
And I fill in "Username" with "user1"
|
|
8
8
|
Then the "#uname" field should contain "user1"
|
|
9
|
-
When I press "Reset"
|
|
10
|
-
And I fill in "
|
|
9
|
+
When I press "Reset" by attr
|
|
10
|
+
And I fill in "Username" with "user2"
|
|
11
11
|
Then the "#uname" field should not contain "user1"
|
|
@@ -6,5 +6,5 @@ Feature: An example to test attach file to field
|
|
|
6
6
|
# Scenario: Check attach file to field
|
|
7
7
|
# Given I am on "/test--when--i-attach-file-to-feild.html"
|
|
8
8
|
# When I attach the file "webshipco.png" to "#fileUpload"
|
|
9
|
-
# When I press "Submit"
|
|
9
|
+
# When I press "Submit" by attr
|
|
10
10
|
# Then I should see "webshipco.png"
|
|
@@ -7,16 +7,16 @@ Feature: An example to uncheck the checkbox
|
|
|
7
7
|
Given I am on "/test--when--i-check-uncheck-checkbox.html"
|
|
8
8
|
When I check "bike"
|
|
9
9
|
And I check "car"
|
|
10
|
-
And I press "Submit"
|
|
10
|
+
And I press "Submit" by "value" attr
|
|
11
11
|
Then I should see "You have a Bike Car"
|
|
12
12
|
When I check "van"
|
|
13
|
-
And I press "Submit"
|
|
13
|
+
And I press "Submit" by "value" attr
|
|
14
14
|
Then I should see "You have a Bike Car Van"
|
|
15
15
|
When I uncheck "bike"
|
|
16
|
-
And I press "Submit"
|
|
16
|
+
And I press "Submit" by "value" attr
|
|
17
17
|
Then I should see "You have a Car Van"
|
|
18
18
|
When I uncheck "car"
|
|
19
19
|
When I uncheck "van"
|
|
20
|
-
And I press "Submit"
|
|
20
|
+
And I press "Submit" by "value" attr
|
|
21
21
|
Then I should see "You have a"
|
|
22
22
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Feature: An example to click link by its attribute
|
|
2
|
+
|
|
3
|
+
As a tester
|
|
4
|
+
I want to be able to click link by its attribute
|
|
5
|
+
|
|
6
|
+
Scenario: Check click link by class attribute
|
|
7
|
+
Given I am on "/test--when--i-click-link.html"
|
|
8
|
+
When I click "#aboutUsid" by attr
|
|
9
|
+
And I wait max of 2 seconds
|
|
10
|
+
Then I should see "About Us"
|
|
11
|
+
|
|
12
|
+
Scenario: Check click link by its id attribute
|
|
13
|
+
Given I am on "/test--when--i-click-link.html"
|
|
14
|
+
When I click "aboutUsid" by its "id" attribute
|
|
15
|
+
And I wait max of 2 seconds
|
|
16
|
+
Then I should see "About Us"
|
|
17
|
+
|
|
18
|
+
Scenario: Check click link by class attribute
|
|
19
|
+
Given I am on "/test--when--i-click-link.html"
|
|
20
|
+
When I click "aboutUs" by "class" attr
|
|
21
|
+
And I wait max of 2 seconds
|
|
22
|
+
Then I should see "About Us"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Feature: An example of filling the input textbox with value by its attribute
|
|
2
|
+
As a tester
|
|
3
|
+
I want to be able to fill input text with value by its attribute
|
|
4
|
+
|
|
5
|
+
Scenario: Check fill in input field with ready format attribute
|
|
6
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
7
|
+
When I fill in "#uname" with "John Smith" by attr
|
|
8
|
+
And I fill in "pwordcss" with "1234" by its "class" attr
|
|
9
|
+
When I press "Login"
|
|
10
|
+
Then I should see "You enter Username: John Smith and Password: 1234"
|
|
11
|
+
|
|
12
|
+
Scenario: Check fill in input field with value and placeholder attribute
|
|
13
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
14
|
+
When I fill in "Your full name" with "John Smith" by its "placeholder" attr
|
|
15
|
+
And I fill in "Your Password" with "1234" by attr
|
|
16
|
+
When I press "Login"
|
|
17
|
+
Then I should see "You enter Username: John Smith and Password: 1234"
|
|
18
|
+
|
|
19
|
+
Scenario: Check fill in value for input field
|
|
20
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
21
|
+
When I fill in "John Smith" for "#uname" by attr
|
|
22
|
+
When I fill in "1234" for "pwordcss" by attr
|
|
23
|
+
When I press "Login"
|
|
24
|
+
Then I should see "You enter Username: John Smith and Password: 1234"
|
|
25
|
+
|
|
26
|
+
Scenario: Check fill in input field with empty value
|
|
27
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
28
|
+
When I fill in "#uname" with: by attribute
|
|
29
|
+
And I fill in "password" with: by attr
|
|
30
|
+
When I press "Login" by attr
|
|
31
|
+
Then I should see "You enter Username: and Password:"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Feature: An example of filling the input text with value by attribute
|
|
2
|
+
As a tester
|
|
3
|
+
I want to be able to fill input text with value by attribute
|
|
4
|
+
|
|
5
|
+
Scenario: Check fill in table of input fields by different attribute
|
|
6
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
7
|
+
When I fill in the following: by attr
|
|
8
|
+
| #uname | John Smith |
|
|
9
|
+
| pwordcss | 1234 |
|
|
10
|
+
When I press "Login"
|
|
11
|
+
Then I should see "You enter Username: John Smith and Password: 1234"
|
|
12
|
+
|
|
13
|
+
Scenario: Check fill in table of input fields by specific attribute
|
|
14
|
+
Given I am on "/test--when--i-fill-in.html"
|
|
15
|
+
When I fill in the following: by its "placeholder" attribute
|
|
16
|
+
| Your full name | John Smith |
|
|
17
|
+
| Your Password | 1234 |
|
|
18
|
+
When I press "Login"
|
|
19
|
+
Then I should see "You enter Username: John Smith and Password: 1234"
|