webship-js 1.0.45 → 1.0.47
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 +2 -0
- package/.claude/settings.local.json +10 -0
- package/.eslintrc.json +0 -0
- package/.github/workflows/github-actions.yml +1 -0
- package/.gitlab-ci.yml +1 -0
- package/assets/config_templates/circleci-linux-chrome.conf.js +13 -1
- package/assets/config_templates/github-linux-chrome.conf.js +13 -1
- package/bitbucket-pipelines.yml +2 -4
- package/examples/about-us.html +0 -0
- package/examples/ajax-wait-examples.html +147 -0
- package/examples/contact-us.html +0 -0
- package/examples/dynamic-examples.html +499 -0
- package/examples/example-api.json +0 -0
- package/examples/existing-page.html +0 -0
- package/examples/index.html +1 -0
- package/examples/test--then--i-should--see-text-in-element.html +0 -0
- package/examples/test--then--i-should--see-text-matching-pattern.html +0 -0
- package/examples/test--then--i-should-see-text-in-table-row.html +0 -0
- package/examples/test--then--the-checkbox-checked.html +0 -0
- package/examples/test--then--the-element-should_not-contain-cssproperty.html +0 -0
- package/examples/test--then--the-link-should-contain.html +0 -0
- package/examples/test--when--i-attach-file-to-feild.html +0 -0
- package/examples/test--when--i-check-uncheck-checkbox.html +0 -0
- package/examples/test--when--i-click-link.html +0 -0
- package/examples/test--when--i-click-text-in-table-row.html +0 -0
- package/examples/test--when--i-press-button.html +0 -0
- package/examples/test--when--i-reload-page.html +0 -0
- package/examples/test--when--i-scroll-functionality.html +0 -0
- package/examples/test--when--i-scroll-left-right-functionality.html +0 -0
- package/examples/test--when--i-select-option-from-dropdownlist.html +0 -0
- package/examples/test--when--i-select-radio-button.html +95 -0
- package/examples/test--when-i-wait-max-of-time.html +0 -0
- package/examples/test--when-i-wait-page-until-is-loaded.html +0 -0
- package/examples/test--when-i-wait-specific-time.html +0 -0
- package/examples/test-acceptable-url-path.html +0 -0
- package/nightwatch.conf.js +22 -4
- package/package.json +4 -4
- package/tests/features/ajax-wait-examples.feature +24 -0
- package/tests/features/api-step-definitions-individual.feature +0 -0
- package/tests/features/complete-api-testing-examples.feature +0 -0
- package/tests/features/dynamic-content-examples.feature +156 -0
- package/tests/features/modal-advanced-example.feature +54 -0
- package/tests/features/modal-basic-example.feature +42 -0
- package/tests/features/modal-error-handling-example.feature +37 -0
- package/tests/features/test--given--i-am-on-homepage.feature +0 -0
- package/tests/features/test--then--i-should--not--see-text-in-element.feature +0 -0
- package/tests/features/test--then--i-should--see-text-in-element-by-attr.feature +0 -0
- package/tests/features/test--then--i-should--see-text-in-element.feature +0 -0
- package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +0 -0
- package/tests/features/test--then--i-should--see-text-matching-pattern.feature +0 -0
- package/tests/features/test--then--i-should-be-on-page.feature +0 -0
- package/tests/features/test--then--i-should-be-on-the-homepage.feature +0 -0
- package/tests/features/test--then--i-should-not-see-an-element-by-attr.feature +0 -0
- package/tests/features/test--then--i-should-not-see-an-element.feature +0 -0
- package/tests/features/test--then--i-should-see-an-element-by-attr.feature +0 -0
- package/tests/features/test--then--i-should-see-an-element.feature +0 -0
- package/tests/features/test--then--i-should-see-text-in-table-row.feature +0 -0
- package/tests/features/test--then--the-checkbox-is-checked.feature +0 -0
- package/tests/features/test--then--the-checkbox-should-be-checked.feature +0 -0
- package/tests/features/test--then--the-element-should-contain-cssproperty.feature +0 -0
- package/tests/features/test--then--the-element-should-not-contain-cssproperty.feature +0 -0
- package/tests/features/test--then--the-field-should-contain-value.feature +0 -0
- package/tests/features/test--then--the-response-should-contain.feature +0 -0
- package/tests/features/test--then--the-response-status-code-should-be.feature +0 -0
- package/tests/features/test--then--the-url-should-match.feature +0 -0
- package/tests/features/test--then-the-link-should-contain-by-attribute.feature +0 -0
- package/tests/features/test--then-the-link-should-contain.feature +0 -0
- package/tests/features/test--when--i-attach-file-to-feild.feature +0 -0
- package/tests/features/test--when--i-check-checkbox.feature +0 -0
- package/tests/features/test--when--i-click-link-by-attribute.feature +0 -0
- package/tests/features/test--when--i-click-link.feature +0 -0
- package/tests/features/test--when--i-click-text-in-table-row.feature +0 -0
- package/tests/features/test--when--i-fill-in-by-attr.feature +0 -0
- package/tests/features/test--when--i-fill-in-table-by-attr.feature +0 -0
- package/tests/features/test--when--i-fill-in.feature +0 -0
- package/tests/features/test--when--i-go-to-homepage.feature +0 -0
- package/tests/features/test--when--i-move-forward-backward-one-page.feature +0 -0
- package/tests/features/test--when--i-press-button-by-attribute.feature +0 -0
- package/tests/features/test--when--i-press-button.feature +0 -0
- package/tests/features/test--when--i-reload-page.feature +0 -0
- package/tests/features/test--when--i-scroll-left-right.feature +0 -0
- package/tests/features/test--when--i-scroll.feature +0 -0
- package/tests/features/test--when--i-select-option-from-dropdownlist.feature +0 -0
- package/tests/features/test--when--i-select-radio-button.feature +37 -0
- package/tests/features/test--when--i-wait-page-is-loaded.feature +0 -0
- package/tests/features/test--when--i-wait-time.feature +0 -0
- package/tests/step-definitions/webship.js +1469 -503
package/.circleci/config.yml
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(FORCE_COLOR=1 node -e \"\nconst {styleText} = require\\('node:util'\\);\nconst {Writable} = require\\('stream'\\);\nconst fakeStream = new Writable\\({write\\(c,e,cb\\){cb\\(\\)}}\\);\nfakeStream.isTTY = false;\nconst result = styleText\\('red', 'test', {stream: fakeStream}\\);\nconsole.log\\('Non-TTY WITH FORCE_COLOR=1:', JSON.stringify\\(result\\)\\);\n\")",
|
|
5
|
+
"Bash(node -e \"\n// Check the full styleText source to understand FORCE_COLOR handling\nconst src = require\\('node:util'\\).styleText.toString\\(\\);\nconsole.log\\(src\\);\n\")",
|
|
6
|
+
"Bash(node -e \"\n// Check what shouldColorize does - it's in node:util internals\n// Let's check how FORCE_COLOR interacts with shouldColorize\nconst util = require\\('node:util'\\);\n\n// The shouldColorize function checks:\n// 1. stream.isTTY\n// 2. FORCE_COLOR env var\n// 3. NO_COLOR env var\n// Let's verify by testing edge cases\n\nconst {Writable} = require\\('stream'\\);\nconst fakeStream = new Writable\\({write\\(c,e,cb\\){cb\\(\\)}}\\);\nfakeStream.isTTY = false;\n\n// Test NO_COLOR\nconst result1 = require\\('child_process'\\).execSync\\(\n 'node -e \\\\\"const {styleText}=require\\(\\\\\\\\\\\\\"node:util\\\\\\\\\\\\\"\\); const {Writable}=require\\(\\\\\\\\\\\\\"stream\\\\\\\\\\\\\"\\); const s=new Writable\\({write\\(c,e,cb\\){cb\\(\\)}}\\); s.isTTY=true; console.log\\(JSON.stringify\\(styleText\\(\\\\\\\\\\\\\"red\\\\\\\\\\\\\",\\\\\\\\\\\\\"x\\\\\\\\\\\\\",{stream:s}\\)\\)\\)\\\\\"',\n {env: {...process.env, NO_COLOR: '1'}}\n\\).toString\\(\\).trim\\(\\);\nconsole.log\\('TTY + NO_COLOR=1:', result1\\);\n\nconst result2 = require\\('child_process'\\).execSync\\(\n 'node -e \\\\\"const {styleText}=require\\(\\\\\\\\\\\\\"node:util\\\\\\\\\\\\\"\\); const {Writable}=require\\(\\\\\\\\\\\\\"stream\\\\\\\\\\\\\"\\); const s=new Writable\\({write\\(c,e,cb\\){cb\\(\\)}}\\); s.isTTY=false; console.log\\(JSON.stringify\\(styleText\\(\\\\\\\\\\\\\"red\\\\\\\\\\\\\",\\\\\\\\\\\\\"x\\\\\\\\\\\\\",{stream:s}\\)\\)\\)\\\\\"',\n {env: {...process.env, FORCE_COLOR: '1'}}\n\\).toString\\(\\).trim\\(\\);\nconsole.log\\('non-TTY + FORCE_COLOR=1:', result2\\);\n\")",
|
|
7
|
+
"Bash(NO_COLOR=1 node -e \"\nconst {styleText} = require\\('node:util'\\);\nconst {Writable} = require\\('stream'\\);\nconst s = new Writable\\({write\\(c,e,cb\\){cb\\(\\)}}\\);\ns.isTTY = true;\nconst result = styleText\\('red', 'x', {stream: s}\\);\nconsole.log\\('TTY + NO_COLOR=1:', JSON.stringify\\(result\\)\\);\n\")"
|
|
8
|
+
]
|
|
9
|
+
}
|
|
10
|
+
}
|
package/.eslintrc.json
CHANGED
|
File without changes
|
package/.gitlab-ci.yml
CHANGED
|
@@ -16,7 +16,19 @@ module.exports = {
|
|
|
16
16
|
options: {
|
|
17
17
|
feature_path: 'tests/features/*.feature',
|
|
18
18
|
additional_config: '',
|
|
19
|
-
parallel:
|
|
19
|
+
parallel: 1,
|
|
20
|
+
'format-options': JSON.stringify({
|
|
21
|
+
colorsEnabled: true,
|
|
22
|
+
theme: {
|
|
23
|
+
'feature keyword': ['bold', 'blue'],
|
|
24
|
+
'feature name': ['blue', 'underline'],
|
|
25
|
+
'feature description': ['blueBright'],
|
|
26
|
+
'scenario keyword': ['bold', 'magenta'],
|
|
27
|
+
'scenario name': ['magenta', 'underline'],
|
|
28
|
+
'step keyword': ['bold', 'green'],
|
|
29
|
+
'step text': ['greenBright', 'italic'],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
20
32
|
},
|
|
21
33
|
},
|
|
22
34
|
globals: {
|
|
@@ -26,7 +26,19 @@ module.exports = {
|
|
|
26
26
|
options: {
|
|
27
27
|
feature_path: 'tests/features/*.feature',
|
|
28
28
|
additional_config: '',
|
|
29
|
-
parallel:
|
|
29
|
+
parallel: 1,
|
|
30
|
+
'format-options': JSON.stringify({
|
|
31
|
+
colorsEnabled: true,
|
|
32
|
+
theme: {
|
|
33
|
+
'feature keyword': ['bold', 'blue'],
|
|
34
|
+
'feature name': ['blue', 'underline'],
|
|
35
|
+
'feature description': ['blueBright'],
|
|
36
|
+
'scenario keyword': ['bold', 'magenta'],
|
|
37
|
+
'scenario name': ['magenta', 'underline'],
|
|
38
|
+
'step keyword': ['bold', 'green'],
|
|
39
|
+
'step text': ['greenBright', 'italic'],
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
30
42
|
},
|
|
31
43
|
|
|
32
44
|
},
|
package/bitbucket-pipelines.yml
CHANGED
package/examples/about-us.html
CHANGED
|
File without changes
|
|
@@ -0,0 +1,147 @@
|
|
|
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>AJAX Wait Examples - Webship Testing</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
font-family: Arial, sans-serif;
|
|
10
|
+
max-width: 1200px;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
padding: 20px;
|
|
13
|
+
background: #f5f5f5;
|
|
14
|
+
}
|
|
15
|
+
.example-section {
|
|
16
|
+
background: white;
|
|
17
|
+
padding: 20px;
|
|
18
|
+
margin: 20px 0;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
21
|
+
}
|
|
22
|
+
button {
|
|
23
|
+
background: #007bff;
|
|
24
|
+
color: white;
|
|
25
|
+
border: none;
|
|
26
|
+
padding: 10px 20px;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
margin: 5px;
|
|
30
|
+
}
|
|
31
|
+
button:hover {
|
|
32
|
+
background: #0056b3;
|
|
33
|
+
}
|
|
34
|
+
input {
|
|
35
|
+
padding: 8px;
|
|
36
|
+
margin: 5px;
|
|
37
|
+
border: 1px solid #ddd;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
width: 300px;
|
|
40
|
+
}
|
|
41
|
+
table {
|
|
42
|
+
width: 100%;
|
|
43
|
+
border-collapse: collapse;
|
|
44
|
+
margin: 10px 0;
|
|
45
|
+
}
|
|
46
|
+
th, td {
|
|
47
|
+
border: 1px solid #ddd;
|
|
48
|
+
padding: 10px;
|
|
49
|
+
text-align: left;
|
|
50
|
+
}
|
|
51
|
+
th {
|
|
52
|
+
background: #f8f9fa;
|
|
53
|
+
}
|
|
54
|
+
.success-message {
|
|
55
|
+
color: green;
|
|
56
|
+
padding: 10px;
|
|
57
|
+
margin: 10px 0;
|
|
58
|
+
background: #d4edda;
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
62
|
+
</head>
|
|
63
|
+
<body>
|
|
64
|
+
<h1>AJAX Wait Testing Examples</h1>
|
|
65
|
+
<p>This page demonstrates scenarios that require waiting for AJAX requests to complete.</p>
|
|
66
|
+
|
|
67
|
+
<!-- Example 1: AJAX Search -->
|
|
68
|
+
<div class="example-section">
|
|
69
|
+
<h2>Example 1: AJAX Search</h2>
|
|
70
|
+
<input type="text" id="search-input" placeholder="Enter search term">
|
|
71
|
+
<button onclick="performSearch()">Search</button>
|
|
72
|
+
<div id="search-results-container"></div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<!-- Example 2: AJAX Form Submission -->
|
|
76
|
+
<div class="example-section">
|
|
77
|
+
<h2>Example 2: AJAX Form Submission</h2>
|
|
78
|
+
<input type="text" id="name-input" placeholder="Your Name"><br>
|
|
79
|
+
<input type="email" id="email-input" placeholder="Your Email"><br>
|
|
80
|
+
<button onclick="submitForm()">Submit</button>
|
|
81
|
+
<div id="form-results-container"></div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
// Example 1: AJAX Search with XMLHttpRequest
|
|
86
|
+
function performSearch() {
|
|
87
|
+
const query = document.getElementById('search-input').value;
|
|
88
|
+
document.getElementById('search-results-container').innerHTML = '<p>Loading...</p>';
|
|
89
|
+
|
|
90
|
+
// Simulate AJAX request
|
|
91
|
+
const xhr = new XMLHttpRequest();
|
|
92
|
+
xhr.open('GET', 'data:text/plain,success', true);
|
|
93
|
+
|
|
94
|
+
xhr.onload = function() {
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
document.getElementById('search-results-container').innerHTML = `
|
|
97
|
+
<h3>Search Results</h3>
|
|
98
|
+
<table>
|
|
99
|
+
<tr>
|
|
100
|
+
<th>Product</th>
|
|
101
|
+
<th>Actions</th>
|
|
102
|
+
</tr>
|
|
103
|
+
<tr>
|
|
104
|
+
<td>Laptop Pro 15</td>
|
|
105
|
+
<td><button onclick="viewDetails('Laptop Pro 15')">View Details</button></td>
|
|
106
|
+
</tr>
|
|
107
|
+
</table>
|
|
108
|
+
`;
|
|
109
|
+
}, 500);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
xhr.send();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function viewDetails(product) {
|
|
116
|
+
document.getElementById('search-results-container').innerHTML = `
|
|
117
|
+
<h3>Product Details</h3>
|
|
118
|
+
<p>Showing details for ${product}</p>
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Example 2: AJAX Form Submission with XMLHttpRequest
|
|
123
|
+
function submitForm() {
|
|
124
|
+
const name = document.getElementById('name-input').value;
|
|
125
|
+
const email = document.getElementById('email-input').value;
|
|
126
|
+
document.getElementById('form-results-container').innerHTML = '<p>Submitting...</p>';
|
|
127
|
+
|
|
128
|
+
// Simulate AJAX request
|
|
129
|
+
const xhr = new XMLHttpRequest();
|
|
130
|
+
xhr.open('POST', 'data:text/plain,success', true);
|
|
131
|
+
|
|
132
|
+
xhr.onload = function() {
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
document.getElementById('form-results-container').innerHTML = `
|
|
135
|
+
<div class="success-message">
|
|
136
|
+
<p>Form submitted successfully</p>
|
|
137
|
+
<p>Thank you, ${name}</p>
|
|
138
|
+
</div>
|
|
139
|
+
`;
|
|
140
|
+
}, 800);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
xhr.send();
|
|
144
|
+
}
|
|
145
|
+
</script>
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
package/examples/contact-us.html
CHANGED
|
File without changes
|