webship-js 1.0.42 → 1.0.44

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 (79) hide show
  1. package/.circleci/config.yml +7 -7
  2. package/.eslintrc.json +0 -0
  3. package/.github/workflows/github-actions.yml +3 -3
  4. package/.gitlab-ci.yml +3 -4
  5. package/CNAME +0 -0
  6. package/README.md +3 -3
  7. package/bitbucket-pipelines.yml +11 -16
  8. package/dist/nightwatch.conf.dev.js +93 -0
  9. package/examples/about-us.html +0 -0
  10. package/examples/contact-us.html +0 -0
  11. package/examples/index.html +0 -0
  12. package/examples/test--then--i-should--see-text-in-element.html +0 -0
  13. package/examples/test--then--i-should--see-text-matching-pattern.html +0 -0
  14. package/examples/test--then--i-should-see-text-in-table-row.html +232 -0
  15. package/examples/test--then--the-checkbox-checked.html +0 -0
  16. package/examples/test--then--the-element-should_not-contain-cssproperty.html +0 -0
  17. package/examples/test--then--the-link-should-contain.html +0 -0
  18. package/examples/test--when--i-attach-file-to-feild.html +0 -0
  19. package/examples/test--when--i-check-uncheck-checkbox.html +0 -0
  20. package/examples/test--when--i-click-link.html +0 -0
  21. package/examples/test--when--i-click-text-in-table-row.html +178 -0
  22. package/examples/test--when--i-press-button.html +0 -0
  23. package/examples/test--when--i-reload-page.html +0 -0
  24. package/examples/test--when--i-scroll-functionality.html +0 -0
  25. package/examples/test--when--i-scroll-left-right-functionality.html +0 -0
  26. package/examples/test--when--i-select-option-from-dropdownlist.html +0 -0
  27. package/examples/test--when-i-wait-max-of-time.html +0 -0
  28. package/examples/test--when-i-wait-page-until-is-loaded.html +0 -0
  29. package/examples/test--when-i-wait-specific-time.html +0 -0
  30. package/generate-reports.js +0 -0
  31. package/nightwatch.conf.js +1 -1
  32. package/package.json +9 -9
  33. package/tests/assets/webshipco.png +0 -0
  34. package/tests/features/api-step-definitions-individual.feature +185 -0
  35. package/tests/features/complete-api-testing-examples.feature +205 -0
  36. package/tests/features/test--given--i-am-on-homepage.feature +2 -2
  37. package/tests/features/test--then--i-should--not--see-text-in-element.feature +2 -2
  38. package/tests/features/test--then--i-should--see-text-in-element-by-attr.feature +2 -2
  39. package/tests/features/test--then--i-should--see-text-in-element.feature +2 -2
  40. package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +2 -2
  41. package/tests/features/test--then--i-should--see-text-matching-pattern.feature +2 -2
  42. package/tests/features/test--then--i-should-be-on-page.feature +2 -2
  43. package/tests/features/test--then--i-should-be-on-the-homepage.feature +2 -2
  44. package/tests/features/test--then--i-should-not-see-an-element-by-attr.feature +2 -2
  45. package/tests/features/test--then--i-should-not-see-an-element.feature +2 -2
  46. package/tests/features/test--then--i-should-see-an-element-by-attr.feature +2 -2
  47. package/tests/features/test--then--i-should-see-an-element.feature +2 -2
  48. package/tests/features/test--then--i-should-see-text-in-table-row.feature +96 -0
  49. package/tests/features/test--then--the-checkbox-is-checked.feature +2 -2
  50. package/tests/features/test--then--the-checkbox-should-be-checked.feature +2 -2
  51. package/tests/features/test--then--the-element-should-contain-cssproperty.feature +2 -2
  52. package/tests/features/test--then--the-element-should-not-contain-cssproperty.feature +2 -2
  53. package/tests/features/test--then--the-field-should-contain-value.feature +2 -2
  54. package/tests/features/test--then--the-response-should-contain.feature +2 -2
  55. package/tests/features/test--then--the-response-status-code-should-be.feature +2 -2
  56. package/tests/features/test--then--the-url-should-match.feature +2 -2
  57. package/tests/features/test--then-the-link-should-contain-by-attribute.feature +2 -2
  58. package/tests/features/test--then-the-link-should-contain.feature +2 -2
  59. package/tests/features/test--when--i-attach-file-to-feild.feature +2 -2
  60. package/tests/features/test--when--i-check-checkbox.feature +2 -2
  61. package/tests/features/test--when--i-click-link-by-attribute.feature +2 -2
  62. package/tests/features/test--when--i-click-link.feature +2 -2
  63. package/tests/features/test--when--i-click-text-in-table-row.feature +37 -0
  64. package/tests/features/test--when--i-fill-in-by-attr.feature +2 -2
  65. package/tests/features/test--when--i-fill-in-table-by-attr.feature +2 -2
  66. package/tests/features/test--when--i-fill-in.feature +2 -2
  67. package/tests/features/test--when--i-go-to-homepage.feature +3 -3
  68. package/tests/features/test--when--i-move-forward-backward-one-page.feature +2 -2
  69. package/tests/features/test--when--i-press-button-by-attribute.feature +2 -2
  70. package/tests/features/test--when--i-press-button.feature +2 -2
  71. package/tests/features/test--when--i-reload-page.feature +2 -2
  72. package/tests/features/test--when--i-scroll-left-right.feature +2 -2
  73. package/tests/features/test--when--i-scroll.feature +2 -2
  74. package/tests/features/test--when--i-select-option-from-dropdownlist.feature +2 -2
  75. package/tests/features/test--when--i-wait-page-is-loaded.feature +2 -2
  76. package/tests/features/test--when--i-wait-time.feature +2 -2
  77. package/tests/step-definitions/webship-api.js +535 -0
  78. package/tests/step-definitions/webship.js +159 -0
  79. package/.yarn/install-state.gz +0 -0
@@ -23,13 +23,12 @@ commands:
23
23
  command: Xvfb -ac :99 -screen 0 1600x1200x24 > /dev/null 2>&1
24
24
  background: true
25
25
 
26
- ## Install node js, npm, yarn, and gulp
26
+ ## Install node js, npm, and gulp
27
27
  - run:
28
28
  name: Install node js
29
29
  command: |
30
30
  curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
31
31
  sudo apt install -y nodejs
32
- sudo npm install -g yarn
33
32
  ## Install Java.
34
33
  - run:
35
34
  name: Install Java
@@ -79,11 +78,12 @@ jobs:
79
78
  <<: *defaults
80
79
  steps:
81
80
  - webship-js-build
82
- ## Automated Functional Acceptance Testing
81
+ ## Install npm dependencies
83
82
  - run:
84
- name: Install yarn
83
+ name: Install npm dependencies
85
84
  command: |
86
- yarn install
85
+ npm install
86
+ ## Automated Functional Acceptance Testing
87
87
  - run:
88
88
  name: Configure nightwatch.conf.js for Circle CI
89
89
  command: |
@@ -92,12 +92,12 @@ jobs:
92
92
  name: Start virtual server
93
93
  command: |
94
94
  export NODE_OPTIONS=--openssl-legacy-provider
95
- yarn start
95
+ npm start
96
96
  background: true
97
97
  - run:
98
98
  name: Test
99
99
  command: |
100
- yarn test
100
+ npm test
101
101
  workflows:
102
102
  version: 2
103
103
  webship-js-workflow:
package/.eslintrc.json CHANGED
File without changes
@@ -50,7 +50,7 @@ jobs:
50
50
 
51
51
 
52
52
  - name: Install dependencies
53
- run: yarn install
53
+ run: npm install
54
54
 
55
55
  - name: Configure nightwatch.conf.js for GitHub
56
56
  run: node webship-init -ci circleci -os linux -b chrome
@@ -58,7 +58,7 @@ jobs:
58
58
  - name: Start virtual server
59
59
  run: |
60
60
  export NODE_OPTIONS=--openssl-legacy-provider
61
- yarn start &
61
+ npm start &
62
62
 
63
63
  - name: Run tests
64
- run: yarn test
64
+ run: npm test
package/.gitlab-ci.yml CHANGED
@@ -14,7 +14,6 @@ before_script:
14
14
  - 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
15
15
  - curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
16
16
  - sudo apt-get install -y nodejs
17
- - sudo npm install -g yarn
18
17
  - sudo apt-get update
19
18
  - sudo apt-get install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
20
19
  - sudo apt-get install -y libu2f-udev
@@ -38,11 +37,11 @@ webship-js-build:
38
37
  script:
39
38
  - wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar
40
39
  - nohup java -jar selenium-server-4.4.0.jar standalone > selenium.log 2>&1 &
41
- - yarn install
40
+ - npm install
42
41
  - node webship-init -ci circleci -os linux -b chrome
43
42
  - export NODE_OPTIONS=--openssl-legacy-provider
44
- - yarn start &
45
- - yarn test
43
+ - npm start &
44
+ - npm test
46
45
 
47
46
  only:
48
47
  refs:
package/CNAME CHANGED
File without changes
package/README.md CHANGED
@@ -12,10 +12,10 @@ Webship-js is an Automated Functional Acceptance Testing tool. Helps to ease and
12
12
  All you need to know is at [webship-js Docs](https://webship.co/docs/webship-js/1.0.x).
13
13
 
14
14
 
15
- ## Install webship-js using Yarn
15
+ ## Install webship-js using npm
16
16
 
17
17
  ```
18
- yarn add webship-js
18
+ npm install webship-js
19
19
  ```
20
20
 
21
21
  ## Install files required by the webship-js tool
@@ -27,5 +27,5 @@ bash <(wget -O - https://raw.githubusercontent.com/webship/wbash/v1/webship-js/v
27
27
  ## Automated Functional Acceptance Testing
28
28
 
29
29
  ```
30
- yarn test
30
+ npm test
31
31
  ```
@@ -1,25 +1,20 @@
1
- image: node:20 # Choose an appropriate Node.js version
1
+ image: node:20
2
2
 
3
3
  pipelines:
4
4
  default:
5
5
  - step:
6
6
  name: Install and Test
7
+ services:
8
+ - selenium
7
9
  caches:
8
10
  - node
9
11
  script:
10
- - npm install # Install your Node.js dependencies
11
- - npm install selenium-webdriver --save # Install the Selenium WebDriver
12
- - npm install chromedriver --save # Install ChromeDriver (for running tests in Chrome)
13
- # Add other dependencies as needed
14
-
15
- # Set up your test environment here (e.g., starting a server, configuring the application)
16
- # For example, if you have a start script defined in your package.json:
17
- # - npm run start & # Start your server in the background
18
-
19
- # Run your tests here, assuming you have a test script defined in your package.json:
20
- - yarn install
21
- - yarn test
22
-
23
-
24
-
12
+ - npm install
13
+ - npm test
25
14
 
15
+ definitions:
16
+ services:
17
+ selenium:
18
+ image: selenium/standalone-chrome:latest
19
+ ports:
20
+ - 4444:4444
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var Services = {};
4
+ loadServices();
5
+ require('events').EventEmitter.defaultMaxListeners = 1000;
6
+ module.exports = {
7
+ // An array of folders (excluding subfolders) where your tests are located;
8
+ // if this is not specified, the test source must be passed as the second argument to the test runner.
9
+ src_folders: ['./tests/step-definitions'],
10
+ // See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
11
+ custom_commands_path: './lib/custom-commands',
12
+ // See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
13
+ custom_assertions_path: './lib/custom-assertions',
14
+ test_runner: {
15
+ type: 'cucumber',
16
+ options: {
17
+ feature_path: './tests/features/*.feature',
18
+ additional_config: '',
19
+ parallel: 1
20
+ }
21
+ },
22
+ globals: {
23
+ assets_folder: "/test/assets/",
24
+ min_wait_time: {
25
+ page: 10000,
26
+ before_scenario: 0,
27
+ after_scenario: 0,
28
+ before_step: 0,
29
+ after_step: 1000
30
+ }
31
+ },
32
+ test_settings: {
33
+ "default": {
34
+ launch_url: 'http://localhost:8080',
35
+ selenium_port: 4444,
36
+ selenium_host: '127.0.0.1',
37
+ silent: true,
38
+ output: false,
39
+ screenshots: {
40
+ enabled: true,
41
+ path: './reports/screenshots'
42
+ },
43
+ desiredCapabilities: {
44
+ browserName: 'chrome',
45
+ 'goog:chromeOptions': {
46
+ // More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
47
+ //
48
+ // w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
49
+ w3c: true,
50
+ args: ['--headless', '--start-maximized', '--disable-gpu', '--window-size=1600,1200', '--no-sandbox', '--disable-dev-shm-usage', '--disable-setuid-sandbox', '--disable-web-security', '--DNS-prefetch-disable', '--disable-translate', '--ignore-certificate-errors', '--test-type', '--disable-extensions', '--incognito', '--disable-infobars', '--remote-debugging-port=9222', '--allowed-ips=*', '--whitelisted-ips=*', '--allow-insecure-localhost']
51
+ }
52
+ }
53
+ }
54
+ },
55
+ selenium_server: {
56
+ // Selenium Server is running locally and is managed by Nightwatch
57
+ selenium: {
58
+ start_process: true,
59
+ port: 4444,
60
+ server_path: Services.seleniumServer ? Services.seleniumServer.path : '',
61
+ cli_args: {
62
+ 'webdriver.gecko.driver': Services.geckodriver ? Services.geckodriver.path : '',
63
+ 'webdriver.chrome.driver': Services.chromedriver ? Services.chromedriver.path : ''
64
+ }
65
+ },
66
+ webdriver: {
67
+ start_process: false
68
+ }
69
+ },
70
+ 'selenium.chrome': {
71
+ "extends": 'selenium_server',
72
+ desiredCapabilities: {
73
+ browserName: 'chrome',
74
+ chromeOptions: {
75
+ w3c: false
76
+ }
77
+ }
78
+ }
79
+ };
80
+
81
+ function loadServices() {
82
+ try {
83
+ Services.seleniumServer = require('selenium-server');
84
+ } catch (err) {}
85
+
86
+ try {
87
+ Services.chromedriver = require('chromedriver');
88
+ } catch (err) {}
89
+
90
+ try {
91
+ Services.geckodriver = require('geckodriver');
92
+ } catch (err) {}
93
+ }
File without changes
File without changes
File without changes
@@ -0,0 +1,232 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Table Row Text Assertion Test</title>
7
+ <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ margin: 20px;
11
+ }
12
+ table {
13
+ border-collapse: collapse;
14
+ width: 100%;
15
+ margin: 20px 0;
16
+ }
17
+ th, td {
18
+ border: 1px solid #ddd;
19
+ padding: 8px;
20
+ text-align: left;
21
+ }
22
+ th {
23
+ background-color: #f2f2f2;
24
+ }
25
+ .status-active { color: #28a745; font-weight: bold; }
26
+ .status-inactive { color: #dc3545; font-weight: bold; }
27
+ .status-pending { color: #ffc107; font-weight: bold; }
28
+ .price { color: #007bff; font-weight: bold; }
29
+ .stock-high { color: #28a745; }
30
+ .stock-low { color: #dc3545; }
31
+ .badge {
32
+ padding: 3px 8px;
33
+ border-radius: 3px;
34
+ font-size: 0.8em;
35
+ font-weight: bold;
36
+ text-transform: uppercase;
37
+ }
38
+ .badge-admin { background-color: #dc3545; color: white; }
39
+ .badge-user { background-color: #17a2b8; color: white; }
40
+ .badge-manager { background-color: #28a745; color: white; }
41
+ .badge-guest { background-color: #6c757d; color: white; }
42
+ </style>
43
+ </head>
44
+ <body>
45
+ <h1>Table Row Text Assertion Test Page</h1>
46
+ <p>This page demonstrates text visibility assertions within table rows for automated testing.</p>
47
+
48
+ <h2>Employee Directory</h2>
49
+ <table id="employees-table">
50
+ <thead>
51
+ <tr>
52
+ <th>Name</th>
53
+ <th>Email</th>
54
+ <th>Department</th>
55
+ <th>Role</th>
56
+ <th>Status</th>
57
+ <th>Salary</th>
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr>
62
+ <td>John Smith</td>
63
+ <td>john.smith@company.com</td>
64
+ <td>Engineering</td>
65
+ <td><span class="badge badge-admin">Admin</span></td>
66
+ <td><span class="status-active">Active</span></td>
67
+ <td class="price">$85,000</td>
68
+ </tr>
69
+ <tr>
70
+ <td>Jane Doe</td>
71
+ <td>jane.doe@company.com</td>
72
+ <td>Marketing</td>
73
+ <td><span class="badge badge-user">User</span></td>
74
+ <td><span class="status-active">Active</span></td>
75
+ <td class="price">$65,000</td>
76
+ </tr>
77
+ <tr>
78
+ <td>Bob Johnson</td>
79
+ <td>bob.johnson@company.com</td>
80
+ <td>Sales</td>
81
+ <td><span class="badge badge-manager">Manager</span></td>
82
+ <td><span class="status-pending">On Leave</span></td>
83
+ <td class="price">$75,000</td>
84
+ </tr>
85
+ <tr>
86
+ <td>Alice Cooper</td>
87
+ <td>alice.cooper@company.com</td>
88
+ <td>HR</td>
89
+ <td><span class="badge badge-user">User</span></td>
90
+ <td><span class="status-inactive">Inactive</span></td>
91
+ <td class="price">$60,000</td>
92
+ </tr>
93
+ </tbody>
94
+ </table>
95
+
96
+ <h2>Product Inventory</h2>
97
+ <table id="inventory-table">
98
+ <thead>
99
+ <tr>
100
+ <th>Product Name</th>
101
+ <th>SKU</th>
102
+ <th>Category</th>
103
+ <th>Price</th>
104
+ <th>Stock</th>
105
+ <th>Availability</th>
106
+ </tr>
107
+ </thead>
108
+ <tbody>
109
+ <tr>
110
+ <td>Wireless Headphones</td>
111
+ <td>WH-2024-001</td>
112
+ <td>Electronics</td>
113
+ <td class="price">$199.99</td>
114
+ <td class="stock-high">150</td>
115
+ <td>In Stock</td>
116
+ </tr>
117
+ <tr>
118
+ <td>Gaming Mouse</td>
119
+ <td>GM-2024-002</td>
120
+ <td>Electronics</td>
121
+ <td class="price">$79.99</td>
122
+ <td class="stock-low">5</td>
123
+ <td>Low Stock</td>
124
+ </tr>
125
+ <tr>
126
+ <td>Office Chair</td>
127
+ <td>OC-2024-003</td>
128
+ <td>Furniture</td>
129
+ <td class="price">$299.99</td>
130
+ <td class="stock-low">0</td>
131
+ <td>Out of Stock</td>
132
+ </tr>
133
+ <tr>
134
+ <td>Laptop Stand</td>
135
+ <td>LS-2024-004</td>
136
+ <td>Accessories</td>
137
+ <td class="price">$49.99</td>
138
+ <td class="stock-high">87</td>
139
+ <td>In Stock</td>
140
+ </tr>
141
+ </tbody>
142
+ </table>
143
+
144
+ <h2>Order History</h2>
145
+ <table id="orders-table">
146
+ <thead>
147
+ <tr>
148
+ <th>Order ID</th>
149
+ <th>Customer</th>
150
+ <th>Product</th>
151
+ <th>Amount</th>
152
+ <th>Status</th>
153
+ <th>Date</th>
154
+ </tr>
155
+ </thead>
156
+ <tbody>
157
+ <tr>
158
+ <td>ORD-2024-001</td>
159
+ <td>Michael Chen</td>
160
+ <td>Wireless Headphones</td>
161
+ <td class="price">$199.99</td>
162
+ <td><span class="status-active">Completed</span></td>
163
+ <td>2024-08-15</td>
164
+ </tr>
165
+ <tr>
166
+ <td>ORD-2024-002</td>
167
+ <td>Sarah Wilson</td>
168
+ <td>Gaming Mouse</td>
169
+ <td class="price">$79.99</td>
170
+ <td><span class="status-pending">Processing</span></td>
171
+ <td>2024-08-16</td>
172
+ </tr>
173
+ <tr>
174
+ <td>ORD-2024-003</td>
175
+ <td>David Miller</td>
176
+ <td>Office Chair</td>
177
+ <td class="price">$299.99</td>
178
+ <td><span class="status-inactive">Cancelled</span></td>
179
+ <td>2024-08-14</td>
180
+ </tr>
181
+ <tr>
182
+ <td>ORD-2024-004</td>
183
+ <td>Emma Davis</td>
184
+ <td>Laptop Stand</td>
185
+ <td class="price">$49.99</td>
186
+ <td><span class="status-active">Shipped</span></td>
187
+ <td>2024-08-13</td>
188
+ </tr>
189
+ </tbody>
190
+ </table>
191
+
192
+ <h2>Project Status</h2>
193
+ <table id="projects-table">
194
+ <thead>
195
+ <tr>
196
+ <th>Project Name</th>
197
+ <th>Manager</th>
198
+ <th>Team Size</th>
199
+ <th>Progress</th>
200
+ <th>Priority</th>
201
+ <th>Due Date</th>
202
+ </tr>
203
+ </thead>
204
+ <tbody>
205
+ <tr>
206
+ <td>Website Redesign</td>
207
+ <td>John Smith</td>
208
+ <td>5 members</td>
209
+ <td>75%</td>
210
+ <td>High</td>
211
+ <td>2024-09-15</td>
212
+ </tr>
213
+ <tr>
214
+ <td>Mobile App</td>
215
+ <td>Jane Doe</td>
216
+ <td>8 members</td>
217
+ <td>45%</td>
218
+ <td>Medium</td>
219
+ <td>2024-10-30</td>
220
+ </tr>
221
+ <tr>
222
+ <td>API Integration</td>
223
+ <td>Bob Johnson</td>
224
+ <td>3 members</td>
225
+ <td>90%</td>
226
+ <td>High</td>
227
+ <td>2024-08-30</td>
228
+ </tr>
229
+ </tbody>
230
+ </table>
231
+ </body>
232
+ </html>
File without changes
File without changes
File without changes
File without changes