webship-js 1.0.47 → 2.0.0-alpha1
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 +15 -63
- package/.claude/settings.local.json +128 -4
- package/.github/workflows/github-actions.yml +7 -37
- package/.gitlab-ci.yml +11 -35
- package/.travis-ci.yml +12 -23
- package/.travis.yml +17 -0
- package/README.md +8 -8
- package/bitbucket-pipelines.yml +3 -7
- package/cucumber.js +36 -0
- package/examples/dynamic-examples.html +1 -2
- package/examples/index.html +0 -1
- package/examples/test--modal-dialogs.html +252 -0
- package/examples/test--when--i-click-text-in-table-row.html +1 -1
- package/examples/test--when--i-scroll-functionality.html +34 -33
- package/examples/test--when--i-scroll-left-right-functionality.html +115 -173
- package/package.json +10 -21
- package/playwright.config.ts +37 -0
- package/tests/assets/test-document.pdf +14 -0
- package/tests/step-definitions/webship-api.js +5 -31
- package/tests/step-definitions/webship.js +849 -2498
- package/tsconfig.json +10 -0
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -34
- package/assets/config_templates/circleci-linux-chrome.conf.js +0 -130
- package/assets/config_templates/github-linux-chrome.conf.js +0 -136
- package/dist/nightwatch.conf.dev.js +0 -93
- package/examples/main.js +0 -17
- package/lib/custom-assertions/checkboxChecked.js +0 -87
- package/lib/custom-assertions/elementContainsCss.js +0 -94
- package/lib/custom-assertions/elementContainsText.js +0 -86
- package/lib/custom-assertions/responseStatus.js +0 -31
- package/lib/custom-assertions/shouldVisible.js +0 -8
- package/lib/custom-assertions/textMatching.js +0 -44
- package/lib/custom-commands/checkItem.js +0 -4
- package/lib/custom-commands/clickLink.js +0 -23
- package/lib/custom-commands/fileUpload.js +0 -37
- package/lib/custom-commands/fillTextInput.js +0 -56
- package/lib/custom-commands/press.js +0 -3
- package/lib/custom-commands/selectOption.js +0 -11
- package/lib/custom-commands/uncheckItem.js +0 -4
- package/lib/custom-commands/wait.js +0 -12
- package/nightwatch.conf.js +0 -136
- package/src/index.js +0 -10
- package/steplist.js +0 -245
- package/webpack.config.js +0 -17
- package/webship-init.js +0 -75
package/.circleci/config.yml
CHANGED
|
@@ -10,71 +10,22 @@ defaults: &defaults
|
|
|
10
10
|
commands:
|
|
11
11
|
webship-js-build:
|
|
12
12
|
steps:
|
|
13
|
-
- checkout
|
|
14
|
-
##
|
|
13
|
+
- checkout
|
|
14
|
+
## Useful must have utils.
|
|
15
15
|
- run:
|
|
16
|
-
name:
|
|
16
|
+
name: Useful must have utils
|
|
17
17
|
command: |
|
|
18
18
|
sudo apt -qq update
|
|
19
19
|
sudo apt -qqy upgrade
|
|
20
20
|
sudo apt -yqq install 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
|
|
21
|
-
sudo apt -yqq install 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
|
|
22
|
-
## Configure and run the virtual display.
|
|
23
|
-
- run:
|
|
24
|
-
name: Configure and run the virtual display.
|
|
25
|
-
command: Xvfb -ac :99 -screen 0 1600x1200x24 > /dev/null 2>&1
|
|
26
|
-
background: true
|
|
27
21
|
|
|
28
|
-
## Install node js, npm
|
|
22
|
+
## Install node js, npm
|
|
29
23
|
- run:
|
|
30
24
|
name: Install node js
|
|
31
25
|
command: |
|
|
32
26
|
curl -sL https://deb.nodesource.com/setup_20.x | sudo bash -
|
|
33
|
-
sudo apt install -y nodejs
|
|
34
|
-
|
|
35
|
-
- run:
|
|
36
|
-
name: Install Java
|
|
37
|
-
command: |
|
|
38
|
-
sudo apt update
|
|
39
|
-
sudo apt install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
|
|
40
|
-
## Install/Update Google Chrome browser.
|
|
41
|
-
- run:
|
|
42
|
-
name: Install/Update Google Chrome browser
|
|
43
|
-
command: |
|
|
44
|
-
sudo apt install libu2f-udev
|
|
45
|
-
sudo apt-get install libgbm1 libvulkan1 libnss3 libgconf-2-4 libxss1 fonts-liberation libappindicator3-1 libatk-bridge2.0-0 xdg-utils libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth
|
|
46
|
-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
47
|
-
sudo dpkg -i google-chrome-stable_current_amd64.deb
|
|
48
|
-
sudo apt-get install -f
|
|
49
|
-
rm google-chrome-stable_current_amd64.deb
|
|
50
|
-
sudo chmod +x /usr/bin/google-chrome
|
|
51
|
-
/usr/bin/google-chrome --version
|
|
52
|
-
google-chrome --version
|
|
53
|
-
- run:
|
|
54
|
-
name: Install/Update Chrome Driver
|
|
55
|
-
command: |
|
|
56
|
-
CHROME_VERSION=$(google-chrome --product-version);
|
|
57
|
-
echo $CHROME_VERSION;
|
|
58
|
-
wget https://storage.googleapis.com/chrome-for-testing-public/$CHROME_VERSION/linux64/chromedriver-linux64.zip
|
|
59
|
-
unzip chromedriver-linux64.zip
|
|
60
|
-
sudo chmod +x chromedriver-linux64/chromedriver
|
|
61
|
-
sudo mv -f chromedriver-linux64/chromedriver /usr/bin/
|
|
62
|
-
rm -rf chromedriver-linux64.zip chromedriver-linux64
|
|
63
|
-
chromedriver --version
|
|
64
|
-
- run:
|
|
65
|
-
name: Install Java
|
|
66
|
-
command: |
|
|
67
|
-
sudo apt update
|
|
68
|
-
sudo apt install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
|
|
69
|
-
- run:
|
|
70
|
-
name: Run Selenium Standalone server
|
|
71
|
-
command: |
|
|
72
|
-
export DISPLAY=:99
|
|
73
|
-
if [[ ! -f /home/circleci/selenium-server-4.4.0.jar ]]; then wget -O /home/circleci/selenium-server-4.4.0.jar https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar; fi
|
|
74
|
-
cd /home/circleci/
|
|
75
|
-
java -jar selenium-server-4.4.0.jar standalone --port 4444
|
|
76
|
-
background: true
|
|
77
|
-
|
|
27
|
+
sudo apt install -y nodejs
|
|
28
|
+
|
|
78
29
|
jobs:
|
|
79
30
|
webship-js-testing:
|
|
80
31
|
<<: *defaults
|
|
@@ -85,17 +36,18 @@ jobs:
|
|
|
85
36
|
name: Install npm dependencies
|
|
86
37
|
command: |
|
|
87
38
|
npm install
|
|
88
|
-
##
|
|
39
|
+
## Install Playwright browsers
|
|
89
40
|
- run:
|
|
90
|
-
name:
|
|
41
|
+
name: Install Playwright browsers
|
|
91
42
|
command: |
|
|
92
|
-
|
|
43
|
+
npx playwright install --with-deps chromium
|
|
93
44
|
- run:
|
|
94
45
|
name: Start virtual server
|
|
95
|
-
command:
|
|
96
|
-
export NODE_OPTIONS=--openssl-legacy-provider
|
|
97
|
-
npm start
|
|
46
|
+
command: npm start
|
|
98
47
|
background: true
|
|
48
|
+
- run:
|
|
49
|
+
name: Wait for server
|
|
50
|
+
command: sleep 3
|
|
99
51
|
- run:
|
|
100
52
|
name: Test
|
|
101
53
|
command: |
|
|
@@ -107,6 +59,6 @@ workflows:
|
|
|
107
59
|
- webship-js-testing:
|
|
108
60
|
filters:
|
|
109
61
|
tags:
|
|
110
|
-
only: /^
|
|
62
|
+
only: /^2.0.*/
|
|
111
63
|
branches:
|
|
112
|
-
only: /^
|
|
64
|
+
only: /^2.0.x/
|
|
@@ -1,10 +1,134 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(
|
|
5
|
-
"Bash(node
|
|
6
|
-
"Bash(
|
|
7
|
-
"Bash(
|
|
4
|
+
"Bash(find /var/www/html/products/webship-js-playwright/webship-js -name \"*.conf.js\" -o -name \"nightwatch.conf.js\" 2>/dev/null | head -20)",
|
|
5
|
+
"Bash(node --version && npm --version && ls /var/www/html/products/webship-js-playwright/webship-js/node_modules | grep playwright 2>/dev/null || echo \"No playwright installed\")",
|
|
6
|
+
"Bash(npm install 2>&1 | tail -5)",
|
|
7
|
+
"Bash(npm install playwright 2>&1 | tail -5)",
|
|
8
|
+
"Bash(npx playwright install chromium 2>&1 | tail -10)",
|
|
9
|
+
"Bash(npx cucumber-js --config cucumber.js --tags \"@smoke or not @smoke\" tests/features/test--when--i-fill-in.feature 2>&1 | head -80)",
|
|
10
|
+
"Bash(npx cucumber-js --config cucumber.js tests/features/test--given--i-am-on-homepage.feature 2>&1)",
|
|
11
|
+
"Bash(node -e \"\n// Test capture group counts\nconst patterns = [\n [/^\\(I |we \\)*press \\\\\"\\([^\\\\\"]*\\)?\\\\\" by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'press by attr'],\n [/^\\(I |we \\)*click \\\\\"\\([^\\\\\"]*\\)?\\\\\" by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'click by attr'],\n [/^\\(I scroll|we scroll|scrolling\\)? down\\( \\([^\\\\\"]*\\)?\\)*$/, 'scroll down'],\n [/^\\(I |we \\)*fill in \\\\\"\\([^\\\\\"]*\\)?\\\\\" with: by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'fill in with by attr'],\n [/^\\(I |we \\)*fill in\\( the\\)* following: by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'fill in following by attr'],\n];\n\nfor \\(const [re, name] of patterns\\) {\n // Count by checking re.source for groups\n const groups = \\(re.source.match\\(/\\(?<!\\\\\\\\\\\\\\\\\\)\\\\\\\\\\(/g\\) || []\\).length;\n // Test against actual strings\n const testStr1 = name.includes\\('scroll'\\) ? 'I scroll down 500' : 'I press \\\\\"btn\\\\\" by \\\\\"id\\\\\" attr';\n const m = re.exec\\(testStr1\\);\n console.log\\(name + ': source groups=' + groups + ', match length=' + \\(m ? m.length - 1 : 'no match'\\)\\);\n}\n\")",
|
|
12
|
+
"Bash(node -e \"\nconst patterns = [\n [/^\\(I |we \\)*press \\\\\"\\([^\\\\\"]*\\)?\\\\\" by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'press by attr', 'I press \\\\\"btn\\\\\" by \\\\\"id\\\\\" attr'],\n [/^\\(I scroll|we scroll|scrolling\\)? down\\( \\([^\\\\\"]*\\)?\\)*$/, 'scroll down', 'I scroll down 500'],\n [/^\\(I scroll|we scroll|scrolling\\)? down\\( \\([^\\\\\"]*\\)?\\)*$/, 'scroll down empty', 'I scroll down'],\n [/^\\(I |we \\)*fill in \\\\\"\\([^\\\\\"]*\\)?\\\\\" with: by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/, 'fill in with by attr', 'I fill in \\\\\"uname\\\\\" with: by attr'],\n];\nfor \\(const [re, name, test] of patterns\\) {\n const m = re.exec\\(test\\);\n console.log\\(name + ': match=' + JSON.stringify\\(m\\)\\);\n}\n\")",
|
|
13
|
+
"Bash(node -e \"\nconst { When } = require\\('./node_modules/@cucumber/cucumber'\\);\n// Test how Cucumber counts args\nconst pattern = /^\\(I |we \\)*press \\\\\"\\([^\\\\\"]*\\)?\\\\\" by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)*\\\\s\\(attribute|attr\\)$/;\nconst fn = async function\\(a, b, c, d, e, f\\) {};\nconsole.log\\('fn.length =', fn.length\\);\n\n// check via Cucumber internals\ntry {\n When\\(pattern, fn\\);\n console.log\\('No error registering with 6 args'\\);\n} catch \\(err\\) {\n console.log\\('Error:', err.message\\);\n}\n\" 2>&1)",
|
|
14
|
+
"Bash(npx cucumber-js --config cucumber.js tests/features/test--when--i-press-button-by-attribute.feature 2>&1 | head -40)",
|
|
15
|
+
"Bash(timeout 120 npm test 2>&1 | tail -100)",
|
|
16
|
+
"Bash(node -e \"\n// Replicate what Cucumber does - check what expression type is used\nconst pattern = /^\\(I |we \\)*press \\\\\"\\([^\\\\\"]*\\)?\\\\\" by\\( its\\)*\\( \\\\\"\\([^\\\\\"]*\\)?\\\\\"\\)* \\(attribute|attr\\)$/;\nconst { RegularExpression } = require\\('/var/www/html/products/webship-js-playwright/webship-js/node_modules/@cucumber/cucumber-expressions'\\);\nconst re = new RegularExpression\\(pattern, {}\\);\nconst text = 'I press \\\\\"Submit\\\\\" by \\\\\"value\\\\\" attr';\nconst matches = re.match\\(text\\);\nconsole.log\\('matches count:', matches ? matches.length : 'null'\\);\nif \\(matches\\) {\n matches.forEach\\(\\(m, i\\) => console.log\\('match', i, ':', JSON.stringify\\(m.getValue\\(null\\)\\)\\)\\);\n}\n\")",
|
|
17
|
+
"Bash(timeout 120 npm test 2>&1 | grep \"✖\\\\|Error:\" | grep -v \"After\\\\|^[[:space:]]*at\" | sort | uniq -c | sort -rn | head -30)",
|
|
18
|
+
"Bash(timeout 120 npm test 2>&1 | grep -A5 \"table.rows is not a function\" | head -20)",
|
|
19
|
+
"Bash(timeout 120 npm test 2>&1 | grep \"✖ When I check\\\\|✖ When I select\" | head -10)",
|
|
20
|
+
"Bash(timeout 120 npm test 2>&1 | grep -A3 \"✖ When I check\" | head -30)",
|
|
21
|
+
"Bash(cat /var/www/html/products/webship-js-playwright/webship-js/tests/html-examples/test--when--i-check-uncheck-checkbox.html 2>/dev/null || find /var/www/html/products/webship-js-playwright/webship-js -name \"*check*uncheck*\" 2>/dev/null | head -5)",
|
|
22
|
+
"Bash(cat /var/www/html/products/webship-js-playwright/webship-js/examples/test--when--i-select-option.html 2>/dev/null || find /var/www/html/products/webship-js-playwright/webship-js/examples -name \"*select*\" 2>/dev/null | head -5)",
|
|
23
|
+
"Bash(timeout 120 npm test 2>&1 | grep -A8 \"✖ When I select\" | head -20)",
|
|
24
|
+
"Bash(timeout 150 npm test 2>&1 | tail -30)",
|
|
25
|
+
"Bash(timeout 200 npm test 2>&1 | grep \"scenarios\\\\|steps\\\\|Error\\\\|failed\\\\|passed\" | tail -20)",
|
|
26
|
+
"Bash(timeout 300 npm test 2>&1 | grep \"scenarios\\\\|steps\\\\|Error:\\\\|AssertionError\" | tail -20)",
|
|
27
|
+
"Bash(timeout 60 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature 2>&1 | tail -50)",
|
|
28
|
+
"Bash(timeout 90 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature 2>&1 | grep \"✔\\\\|✖\\\\|scenarios\\\\|steps\" | tail -30)",
|
|
29
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8080/ 2>/dev/null; echo \"\")",
|
|
30
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8080/test--when--i-scroll-functionality.html 2>/dev/null; echo \"\")",
|
|
31
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n const beforeY = await page.evaluate\\(\\(\\) => window.scrollY\\);\n console.log\\('Before scroll Y:', beforeY\\);\n console.log\\('Doc height:', await page.evaluate\\(\\(\\) => document.documentElement.scrollHeight\\)\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(500\\);\n \n const afterY = await page.evaluate\\(\\(\\) => window.scrollY\\);\n console.log\\('After scroll Y:', afterY\\);\n \n const text = await page.evaluate\\(\\(\\) => document.documentElement.innerText\\);\n console.log\\('Has basic-scroll-down text:', text.includes\\('Basic scroll down works'\\)\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
32
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(500\\); // wait for debounce\n \n const result = await page.evaluate\\(\\(\\) => {\n const el = document.getElementById\\('basic-scroll-down'\\);\n return {\n display: el ? window.getComputedStyle\\(el\\).display : 'not found',\n scrollY: window.scrollY,\n text: el ? el.textContent : null,\n innerTextVisible: \\(document.documentElement.innerText || ''\\).includes\\('Basic scroll down works'\\)\n };\n }\\);\n console.log\\(JSON.stringify\\(result, null, 2\\)\\);\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
33
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n // Intercept to check if scroll event fires\n await page.evaluate\\(\\(\\) => {\n window._scrollFired = false;\n window.addEventListener\\('scroll', \\(\\) => { window._scrollFired = true; }\\);\n }\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(500\\);\n \n const result = await page.evaluate\\(\\(\\) => \\({\n scrollFired: window._scrollFired,\n scrollY: window.scrollY,\n display: window.getComputedStyle\\(document.getElementById\\('basic-scroll-down'\\)\\).display\n }\\)\\);\n console.log\\(JSON.stringify\\(result, null, 2\\)\\);\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
34
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n // Check setTimeout works\n await page.evaluate\\(\\(\\) => {\n window._timeoutFired = false;\n setTimeout\\(\\(\\) => { window._timeoutFired = true; }, 200\\);\n }\\);\n await page.waitForTimeout\\(500\\);\n const fired = await page.evaluate\\(\\(\\) => window._timeoutFired\\);\n console.log\\('setTimeout fired:', fired\\);\n \n // Now scroll and check\n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(300\\);\n \n const result = await page.evaluate\\(\\(\\) => \\({\n scrollY: window.scrollY,\n display: window.getComputedStyle\\(document.getElementById\\('basic-scroll-down'\\)\\).display\n }\\)\\);\n console.log\\('After scroll + 300ms wait:', result\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
35
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n // Patch the scroll handler to log\n await page.evaluate\\(\\(\\) => {\n window._debugLog = [];\n const origListener = window.addEventListener.bind\\(window\\);\n // Manual trigger\n window._manualCheck = function\\(\\) {\n const scrollY = window.scrollY;\n const windowHeight = window.innerHeight;\n const documentHeight = document.documentElement.scrollHeight;\n window._debugLog.push\\({scrollY, windowHeight, documentHeight, check: scrollY >= 300 && scrollY <= 400}\\);\n if \\(scrollY >= 300 && scrollY <= 400\\) {\n document.getElementById\\('basic-scroll-down'\\).style.display = 'block';\n }\n };\n }\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(300\\);\n \n // Manually trigger check\n await page.evaluate\\(\\(\\) => window._manualCheck\\(\\)\\);\n \n const result = await page.evaluate\\(\\(\\) => \\({\n debugLog: window._debugLog,\n display: window.getComputedStyle\\(document.getElementById\\('basic-scroll-down'\\)\\).display\n }\\)\\);\n console.log\\(JSON.stringify\\(result, null, 2\\)\\);\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
36
|
+
"Bash(timeout 15 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n \n // Patch scrollTimeout tracking\n await page.evaluate\\(\\(\\) => {\n window._scrollCallbackFired = false;\n // Intercept the scroll handler by patching setTimeout\n const orig = window.setTimeout;\n window.setTimeout = function\\(fn, delay\\) {\n return orig\\(function\\(\\) { \n window._scrollCallbackFired = true;\n fn\\(\\);\n }, delay\\);\n };\n }\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n await page.waitForTimeout\\(500\\);\n \n const result = await page.evaluate\\(\\(\\) => \\({\n scrollCallbackFired: window._scrollCallbackFired,\n scrollY: window.scrollY,\n display: window.getComputedStyle\\(document.getElementById\\('basic-scroll-down'\\)\\).display\n }\\)\\);\n console.log\\(JSON.stringify\\(result, null, 2\\)\\);\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1)",
|
|
37
|
+
"Bash(timeout 60 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature 2>&1 | grep \"✔\\\\|✖\\\\|scenarios\\\\|steps\" | tail -20)",
|
|
38
|
+
"Bash(timeout 60 npx cucumber-js --config cucumber.js --name \"Test basic scroll down functionality\" 2>&1 | tail -20)",
|
|
39
|
+
"Bash(timeout 30 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature --name \"Test basic scroll down\" 2>&1 | tail -20)",
|
|
40
|
+
"Bash(timeout 30 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature --name \"Test basic scroll down functionality\" 2>&1 | tail -15)",
|
|
41
|
+
"Bash(timeout 90 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature 2>&1 | grep \"✔\\\\|✖\\\\|scenarios\\\\|steps\" | tail -20)",
|
|
42
|
+
"Bash(timeout 30 node -e \"\nconst { execSync } = require\\('child_process'\\);\ntry {\n const result = execSync\\(\n 'npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature --scenario-filter 1',\n { timeout: 25000, cwd: '/var/www/html/products/webship-js-playwright/webship-js' }\n \\);\n console.log\\(result.toString\\(\\).slice\\(-500\\)\\);\n} catch\\(e\\) {\n console.log\\('FAILED:', e.stdout ? e.stdout.toString\\(\\).slice\\(-500\\) : e.message\\);\n}\n\" 2>&1 | tail -30)",
|
|
43
|
+
"Bash(timeout 25 npx cucumber-js --config cucumber.js \"tests/features/test--when--i-scroll.feature:5\" 2>&1 | tail -20)",
|
|
44
|
+
"Bash(timeout 20 node -e \"\nconst { chromium } = require\\('playwright'\\);\nconst { setWorldConstructor, World, Before, After } = require\\('@cucumber/cucumber'\\);\n// Simple test to see if scroll.feature scenario hangs\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n console.log\\('navigating...'\\);\n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n console.log\\('scrolling...'\\);\n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n console.log\\('checking text...'\\);\n const bodyText = await page.evaluate\\(\\(\\) => document.documentElement.textContent || ''\\);\n console.log\\('includes Basic scroll down works:', bodyText.includes\\('Basic scroll down works'\\)\\);\n await browser.close\\(\\);\n console.log\\('done'\\);\n}\\)\\(\\);\n\" 2>&1)",
|
|
45
|
+
"Bash(timeout 20 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature:5 2>&1 | tail -30)",
|
|
46
|
+
"Bash(timeout 15 node -e \"\nconst { loadConfiguration, runCucumber } = require\\('@cucumber/cucumber/api'\\);\nprocess.chdir\\('/var/www/html/products/webship-js-playwright/webship-js'\\);\n\\(async \\(\\) => {\n const { runConfiguration } = await loadConfiguration\\({\n provided: {\n paths: ['tests/features/test--when--i-scroll.feature:5'],\n require: ['tests/support/world.js', 'tests/step-definitions/webship.js', 'tests/step-definitions/webship-api.js'],\n timeout: 10000,\n }\n }\\);\n const { success } = await runCucumber\\(runConfiguration\\);\n console.log\\('Success:', success\\);\n process.exit\\(success ? 0 : 1\\);\n}\\)\\(\\).catch\\(e => { console.error\\(e.message\\); process.exit\\(1\\); }\\);\n\" 2>&1 | tail -20)",
|
|
47
|
+
"Bash(timeout 15 node -e \"\nconst { Given, When, Then, Before, After, setWorldConstructor, World, setDefaultTimeout } = require\\('@cucumber/cucumber'\\);\nconst { chromium } = require\\('playwright'\\);\n\nsetDefaultTimeout\\(10000\\);\n\nclass TestWorld extends World {\n constructor\\(opt\\) { super\\(opt\\); this.page = null; this.launchUrl = 'http://localhost:8080'; this.minWaitTime = {page:3000}; }\n async openBrowser\\(\\) {\n const b = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const ctx = await b.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n this.page = await ctx.newPage\\(\\);\n this.b = b;\n }\n async closeBrowser\\(\\) { if \\(this.b\\) { await this.b.close\\(\\); this.b = null; } }\n}\n\nsetWorldConstructor\\(TestWorld\\);\nBefore\\(async function \\(\\) { \n console.log\\('BEFORE start'\\);\n await this.openBrowser\\(\\); \n console.log\\('BEFORE done'\\);\n}\\);\nAfter\\(async function \\(\\) { \n console.log\\('AFTER start'\\);\n await this.closeBrowser\\(\\); \n console.log\\('AFTER done'\\);\n}\\);\n\nGiven\\(/^I am on page \\\\\"\\([^\\\\\"]*\\)\\\\\"$/, async function\\(url\\) {\n console.log\\('GIVEN start'\\);\n await this.page.goto\\(this.launchUrl + url\\);\n console.log\\('GIVEN navigate done'\\);\n await this.page.waitForLoadState\\('domcontentloaded', {timeout:5000}\\);\n console.log\\('GIVEN done'\\);\n}\\);\n\nWhen\\(/^I scroll down step$/, async function\\(\\) {\n console.log\\('WHEN start'\\);\n await this.page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n console.log\\('WHEN done'\\);\n}\\);\n\nThen\\(/^I should see text \\\\\"\\([^\\\\\"]*\\)\\\\\"$/, async function\\(text\\) {\n console.log\\('THEN start'\\);\n const bodyText = await this.page.evaluate\\(\\(\\) => document.documentElement.textContent || ''\\);\n console.log\\('THEN bodyText includes:', bodyText.includes\\(text\\)\\);\n console.log\\('THEN done'\\);\n}\\);\n\n// Run it\nconst { runCucumber, loadConfiguration } = require\\('@cucumber/cucumber/api'\\);\nprocess.chdir\\('/var/www/html/products/webship-js-playwright/webship-js'\\);\n\\(async \\(\\) => {\n // Write temp feature\n const fs = require\\('fs'\\);\n fs.writeFileSync\\('/tmp/test.feature', \\\\`\nFeature: Test\n Scenario: Test scroll\n Given I am on page \\\\\"/test--when--i-scroll-functionality.html\\\\\"\n When I scroll down step\n Then I should see text \\\\\"Basic scroll down works\\\\\"\n \\\\`\\);\n \n const { runConfiguration } = await loadConfiguration\\({ provided: { paths: ['/tmp/test.feature'], require: [] } }\\);\n const { success } = await runCucumber\\(runConfiguration\\);\n console.log\\('Success:', success\\);\n}\\)\\(\\).catch\\(e => console.error\\(e.message\\)\\);\n\" 2>&1)",
|
|
48
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8080/dynamic-examples.html 2>/dev/null; echo \"\")",
|
|
49
|
+
"Bash(timeout 120 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature 2>&1 | grep \"✔\\\\|✖\\\\|scenarios\\\\|steps\" | tail -20)",
|
|
50
|
+
"Bash(timeout 30 node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const start = Date.now\\(\\);\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox'] }\\);\n const ctx = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await ctx.newPage\\(\\);\n console.log\\('Browser launched:', Date.now\\(\\)-start, 'ms'\\);\n \n await page.goto\\('http://localhost:8080/test--when--i-scroll-functionality.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n console.log\\('Page loaded:', Date.now\\(\\)-start, 'ms'\\);\n \n await page.evaluate\\(\\(\\) => window.scrollBy\\(0, 350\\)\\);\n console.log\\('Scrolled:', Date.now\\(\\)-start, 'ms'\\);\n \n const text = await page.evaluate\\(\\(\\) => document.documentElement.textContent || ''\\);\n console.log\\('Text checked:', Date.now\\(\\)-start, 'ms', 'has text:', text.includes\\('Basic scroll down works'\\)\\);\n \n await browser.close\\(\\);\n console.log\\('Done:', Date.now\\(\\)-start, 'ms'\\);\n}\\)\\(\\);\n\" 2>&1)",
|
|
51
|
+
"Bash(timeout 120 npx cucumber-js --config cucumber.js tests/features/test--when--i-scroll.feature --format progress 2>&1 | head -50)",
|
|
52
|
+
"Bash(timeout 360 npm test 2>&1 | tail -15)",
|
|
53
|
+
"Bash(timeout 360 npm test 2>&1 | grep \"✖\\\\|Error:\" | grep -v \"After\\\\|^[[:space:]]*at\" | sort | uniq -c | sort -rn | head -30)",
|
|
54
|
+
"Bash(timeout 360 npm test 2>&1 | grep -A5 \"✖ When I click.*by attr\\\\|✖ When I click.*row\\\\|✖ When I select\\\\|✖ Then I should see.*Username\" | head -80)",
|
|
55
|
+
"Bash(curl -s http://localhost:8080/test--modal-dialogs.html | grep -i \"show-modal\\\\|trigger-modal\\\\|delete-btn\" | head -10)",
|
|
56
|
+
"Bash(curl -s -o /dev/null -w \"%{http_code}\" http://localhost:8080/test--modal-dialogs.html; echo)",
|
|
57
|
+
"Bash(timeout 360 npm test 2>&1 | grep -A8 \"✖ When I click.*row\\\\|✖ When I select.*#cars\\\\|✖ Then the.*element should contain\\\\|✖ Then the.*link should contain\\\\|✖ Then I should see.*element by attr\\\\|✖ Then I should see.*action-message\\\\|✖ Then I should see.*Username\" | grep -v \"^$\" | head -100)",
|
|
58
|
+
"Bash(npm test 2>&1 | tail -80)",
|
|
59
|
+
"Bash(npm test 2>&1 | grep -E \"^[0-9]+\\\\\\) Scenario:|✖|Error:|AssertionError\" | head -120)",
|
|
60
|
+
"Bash(npm test 2>&1 | head -100)",
|
|
61
|
+
"Bash(npm install 2>&1 | tail -20)",
|
|
62
|
+
"Bash(npm test 2>&1 | tail -60)",
|
|
63
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js 2>&1 | sed 's/\\\\x1b\\\\[[0-9;]*m//g' > /tmp/test-output.txt; echo \"Exit: $?\")",
|
|
64
|
+
"Bash(for i in 2 3 4 5 6 7 18 25 26 28 30; do echo \"=== Scenario $i ===\"; grep -A 20 \"^$i\\) Scenario\" /tmp/test-output.txt | grep -E \"✖|Error:|AssertionError\" | head -5; done)",
|
|
65
|
+
"Bash(curl -s http://localhost:8080/ | head -5 2>&1 || echo \"Server not running\")",
|
|
66
|
+
"Bash(curl -s http://localhost:8080/test--when--i-fill-in.html | head -30)",
|
|
67
|
+
"Bash(curl -s http://localhost:8080/test--when--i-select-option-from-dropdownlist.html | head -30)",
|
|
68
|
+
"Bash(curl -s http://localhost:8080/test--when--i-fill-in.html)",
|
|
69
|
+
"Bash(curl -s http://localhost:8080/test--when--i-reload-page.html)",
|
|
70
|
+
"Bash(curl -s http://localhost:8080/test--then--the-element-should_not-contain-cssproperty.html)",
|
|
71
|
+
"Bash(curl -s http://localhost:8080/dynamic-examples.html | grep -i \"data-page\\\\|product\\\\|Products\\\\|nav\\\\|scroll\" | head -30)",
|
|
72
|
+
"Bash(curl -s http://localhost:8080/test--modal-dialogs.html 2>&1 | head -20)",
|
|
73
|
+
"Bash(curl -s http://localhost:8080/dynamic-examples.html | head -5)",
|
|
74
|
+
"Bash(curl -s http://localhost:8080/ajax-wait-examples.html | head -5)",
|
|
75
|
+
"Bash(curl -s http://localhost:8080/dynamic-examples.html | grep -A5 \"data-page\\\\|count\\\\|Count\\\\|infinite\")",
|
|
76
|
+
"Bash(curl -s http://localhost:8080/ajax-wait-examples.html)",
|
|
77
|
+
"Bash(curl -s http://localhost:8080/test--when--i-scroll-left-right-functionality.html)",
|
|
78
|
+
"Bash(curl -s http://localhost:8080/test--when--i-click-text-in-table-row.html)",
|
|
79
|
+
"Bash(printf '%PDF-1.4\\\\n1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj\\\\n2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj\\\\n3 0 obj<</Type/Page/MediaBox[0 0 612 792]/Parent 2 0 R>>endobj\\\\nxref\\\\n0 4\\\\n0000000000 65535 f\\\\n0000000009 00000 n\\\\n0000000058 00000 n\\\\n0000000115 00000 n\\\\ntrailer<</Size 4/Root 1 0 R>>\\\\nstartxref\\\\n190\\\\n%%EOF' > /var/www/html/products/webship-js-playwright2/webship-js/tests/assets/test-document.pdf)",
|
|
80
|
+
"Bash(node -e \"const fs=require\\('fs'\\); fs.writeFileSync\\('/var/www/html/products/webship-js-playwright2/webship-js/tests/assets/test-document.pdf', '%PDF-1.4\\\\n1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj\\\\n2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj\\\\n3 0 obj<</Type/Page/MediaBox[0 0 612 792]/Parent 2 0 R>>endobj\\\\nxref\\\\n0 4\\\\n0000000000 65535 f \\\\n0000000009 00000 n \\\\n0000000058 00000 n \\\\n0000000115 00000 n \\\\ntrailer<</Size 4/Root 1 0 R>>\\\\nstartxref\\\\n190\\\\n%%EOF\\\\n'\\);\")",
|
|
81
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js 2>&1 | tee /tmp/test-output2.txt | tail -10)",
|
|
82
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js 2>&1 | sed 's/\\\\x1b\\\\[[0-9;]*m//g' > /tmp/test3.txt; echo \"Done: $?\")",
|
|
83
|
+
"Bash(for i in 1 2 6 10 13 14 21 24 32; do echo \"=== $i ===\"; grep -A 15 \"^$i\\) Scenario\" /tmp/test3.txt | grep -E \"✖|Error:|AssertionError\" | head -3; done)",
|
|
84
|
+
"Bash(curl -s http://localhost:8080/test--modal-dialogs.html | grep \"show-welcome-modal\" | head -3)",
|
|
85
|
+
"Bash(curl -s http://localhost:8080/test--modal-dialogs.html | head -5)",
|
|
86
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js 2>&1 | sed 's/\\\\x1b\\\\[[0-9;]*m//g' > /tmp/test_current.txt && tail -20 /tmp/test_current.txt)",
|
|
87
|
+
"Bash(grep -A25 \"14\\) Scenario:\" /tmp/test_current.txt | tail -20\ngrep -A25 \"15\\) Scenario:\" /tmp/test_current.txt | head -35)",
|
|
88
|
+
"Bash(node -e \"const pw = require\\('playwright'\\); console.log\\(pw.chromium._defaultBrowserType\\)\" 2>/dev/null; cat /var/www/html/products/webship-js-playwright2/webship-js/package.json | grep playwright)",
|
|
89
|
+
"Bash(node -e \"const pw = require\\('playwright'\\); console.log\\(require\\('./node_modules/playwright/package.json'\\).version\\)\")",
|
|
90
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n \n // Try fill with comma-separated selector\n const sel = 'pwordcss,#pwordcss,.pwordcss,[name=pwordcss]';\n try {\n await page.waitForSelector\\(sel, {timeout: 2000}\\);\n console.log\\('waitForSelector OK'\\);\n await page.fill\\(sel, '1234'\\);\n console.log\\('fill OK'\\);\n } catch\\(e\\) {\n console.log\\('Error:', e.message\\);\n }\n \n // Fill username too\n await page.fill\\('#uname', 'John Smith'\\);\n \n // Check values\n const vals = await page.evaluate\\(\\(\\) => \\({\n uname: document.getElementById\\('uname'\\).value,\n pword: document.getElementById\\('pword'\\).value,\n }\\)\\);\n console.log\\('Values:', vals\\);\n \n // Click the button\n await page.evaluate\\(\\(\\) => { document.getElementById\\('btnLogin'\\).click\\(\\); }\\);\n \n const result = await page.evaluate\\(\\(\\) => document.getElementById\\('result'\\).innerText\\);\n console.log\\('Result:', result\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
91
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n \n // Scenario 14: fill by attr\n await page.fill\\('#uname', 'John Smith'\\);\n await page.fill\\('pwordcss,#pwordcss,.pwordcss,[name=pwordcss],[value=\\\\\"pwordcss\\\\\"],[placeholder=\\\\\"pwordcss\\\\\"],[title=\\\\\"pwordcss\\\\\"]', '1234'\\);\n \n // Press Login - simulate what the step does\n const locator = page.locator\\('button, input[type=\\\\\"button\\\\\"], input[type=\\\\\"submit\\\\\"], [role=\\\\\"button\\\\\"], .btn, a'\\).filter\\({ hasText: /^Login$/ }\\);\n const count = await locator.count\\(\\);\n console.log\\('Locator count:', count\\);\n \n try {\n await locator.first\\(\\).waitFor\\({ state: 'visible', timeout: 1000 }\\);\n await locator.first\\(\\).click\\(\\);\n console.log\\('Primary click worked'\\);\n } catch\\(e\\) {\n console.log\\('Primary failed, trying fallback'\\);\n const found = await page.evaluate\\(\\(buttonText\\) => {\n const buttons = document.querySelectorAll\\('button, input[type=\\\\\"button\\\\\"], input[type=\\\\\"submit\\\\\"], [role=\\\\\"button\\\\\"], .btn, a'\\);\n for \\(const btn of buttons\\) {\n const text = \\(btn.textContent || btn.innerText || btn.value || ''\\).trim\\(\\);\n if \\(text === buttonText\\) { btn.click\\(\\); return true; }\n }\n return false;\n }, 'Login'\\);\n console.log\\('Fallback found:', found\\);\n }\n \n await page.waitForTimeout\\(100\\);\n const bodyText = await page.evaluate\\(\\(\\) => document.body.innerText || ''\\);\n console.log\\('Body includes expected text:', bodyText.includes\\('You enter Username: John Smith and Password: 1234'\\)\\);\n console.log\\('Result div:', await page.evaluate\\(\\(\\) => document.getElementById\\('result'\\).innerText\\)\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
92
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js tests/features/test--when--i-fill-in-table-by-attr.feature 2>&1 | sed 's/\\\\x1b\\\\[[0-9;]*m//g')",
|
|
93
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js --tags \"@fill\" 2>&1 | head -5 ; ./node_modules/.bin/cucumber-js tests/features/test--when--i-fill-in-table-by-attr.feature tests/features/test--when--i-fill-in.feature --require tests/support/world.js --require \"tests/step-definitions/**/*.js\" --format @cucumber/pretty-formatter 2>&1 | sed 's/\\\\x1b\\\\[[0-9;]*m//g' | tail -40)",
|
|
94
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.setViewportSize\\({ width: 1600, height: 1200 }\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n await page.waitForSelector\\('body', {timeout: 3000}\\);\n\n // Simulate fill-in table by attr\n const sel1 = '#uname';\n const sel2 = 'pwordcss,#pwordcss,.pwordcss,[name=pwordcss],[value=\\\\\"pwordcss\\\\\"],[placeholder=\\\\\"pwordcss\\\\\"],[title=\\\\\"pwordcss\\\\\"]';\n \n await page.waitForSelector\\(sel1, {timeout: 5000}\\);\n await page.fill\\(sel1, 'John Smith'\\);\n \n await page.waitForSelector\\(sel2, {timeout: 5000}\\);\n await page.fill\\(sel2, '1234'\\);\n \n // Check values before click\n const valsBefore = await page.evaluate\\(\\(\\) => \\({\n uname: document.getElementById\\('uname'\\).value,\n pword: document.getElementById\\('pword'\\).value\n }\\)\\);\n console.log\\('Values before click:', valsBefore\\);\n \n // Press Login - primary locator path\n const locator = page.locator\\('button, input[type=\\\\\"button\\\\\"], input[type=\\\\\"submit\\\\\"], [role=\\\\\"button\\\\\"], .btn, a'\\)\n .filter\\({ hasText: /^Login$/ }\\);\n const count = await locator.count\\(\\);\n console.log\\('Button locator count:', count\\);\n await locator.first\\(\\).waitFor\\({ state: 'visible', timeout: 10000 }\\);\n await locator.first\\(\\).click\\(\\);\n \n await page.waitForTimeout\\(200\\);\n const bodyText = await page.evaluate\\(\\(\\) => document.body.innerText || ''\\);\n const resultText = await page.evaluate\\(\\(\\) => document.getElementById\\('result'\\).innerText\\);\n console.log\\('Result div:', resultText\\);\n console.log\\('Body includes expected:', bodyText.includes\\('You enter Username: John Smith and Password: 1234'\\)\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
95
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n \n // Check if script content contains any relevant text \n const textContent = await page.evaluate\\(\\(\\) => document.body.innerText\\);\n console.log\\('Initial body.innerText:'\\);\n console.log\\(JSON.stringify\\(textContent\\).substring\\(0, 200\\)\\);\n \n // Check if the text matches even before fill\n console.log\\('Contains John Smith before fill:', textContent.includes\\('John Smith'\\)\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
96
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n \n await page.fill\\('#uname', 'John Smith'\\);\n await page.fill\\('#pword', '1234'\\);\n \n await page.locator\\('button, input[type=\\\\\"button\\\\\"]'\\).filter\\({hasText: /^Login\\\\$/}\\).first\\(\\).click\\(\\);\n \n // Check immediately\n const bodyText = await page.evaluate\\(\\(\\) => document.body.innerText\\);\n console.log\\('After click, body.innerText:'\\);\n console.log\\(JSON.stringify\\(bodyText\\)\\);\n console.log\\('Contains expected:', bodyText.includes\\('You enter Username: John Smith and Password: 1234'\\)\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
97
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true }\\);\n const page = await browser.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n \n // Check the exact selector from buildSelector\n const sel = 'pwordcss,#pwordcss,.pwordcss,[name=pwordcss],[value=\\\\\"pwordcss\\\\\"],[placeholder=\\\\\"pwordcss\\\\\"],[title=\\\\\"pwordcss\\\\\"]';\n const count = await page.locator\\(sel\\).count\\(\\);\n console.log\\('Selector matches:', count\\);\n \n // Try fill and check strict mode\n try {\n await page.fill\\(sel, '1234'\\);\n console.log\\('fill OK'\\);\n } catch\\(e\\) {\n console.log\\('fill error:', e.message.substring\\(0, 200\\)\\);\n }\n \n // Check value\n const val = await page.evaluate\\(\\(\\) => document.getElementById\\('pword'\\).value\\);\n console.log\\('pword.value:', val\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
98
|
+
"Bash(./node_modules/.bin/cucumber-js --config cucumber.js 2>&1 | grep -E \"\\\\[DEBUG\\\\]\" | head -20)",
|
|
99
|
+
"Bash(node -e \"\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox','--disable-dev-shm-usage','--incognito'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n await page.waitForSelector\\('body', {timeout: 3000}\\);\n\n // Step 1: fill uname\n await page.waitForSelector\\('#uname', {timeout: 5000}\\);\n await page.fill\\('#uname', 'John Smith'\\);\n \n // Check value after first fill\n const v1 = await page.evaluate\\(\\(\\) => document.getElementById\\('uname'\\).value\\);\n console.log\\('uname after fill:', v1\\);\n \n // Step 2: fill pwordcss\n const sel = 'pwordcss,#pwordcss,.pwordcss,[name=pwordcss],[value=\\\\\"pwordcss\\\\\"],[placeholder=\\\\\"pwordcss\\\\\"],[title=\\\\\"pwordcss\\\\\"]';\n await page.waitForSelector\\(sel, {timeout: 5000}\\);\n await page.fill\\(sel, '1234'\\);\n \n // Check value after second fill\n const v2 = await page.evaluate\\(\\(\\) => document.getElementById\\('uname'\\).value\\);\n console.log\\('uname after second fill:', v2\\);\n \n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\n\" 2>&1)",
|
|
100
|
+
"Bash(node /tmp/test_fill.js 2>&1)",
|
|
101
|
+
"Bash(cp /tmp/test_fill.js /var/www/html/products/webship-js-playwright2/webship-js/test_fill.js && node test_fill.js && rm test_fill.js)",
|
|
102
|
+
"Bash(cat > /tmp/test_fill2.js << 'EOF'\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox','--disable-dev-shm-usage'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n\n // Simulate label-based fill \\(fill in the following:\\)\n const filled = await page.evaluate\\(\\(fillData\\) => {\n const results = [];\n for \\(const { field, value } of fillData\\) {\n const label = Array.from\\(document.querySelectorAll\\('label'\\)\\).find\\(l => l.textContent.trim\\(\\) === field\\);\n let el = null;\n if \\(label && label.htmlFor\\) { el = document.getElementById\\(label.htmlFor\\); }\n if \\(!el && label\\) {\n const p = label.closest\\('p, div, td, li'\\);\n if \\(p\\) { const sib = p.nextElementSibling; if \\(sib\\) el = sib.querySelector\\('input, textarea'\\) || \\(sib.tagName === 'INPUT' || sib.tagName === 'TEXTAREA' ? sib : null\\); }\n }\n if \\(!el\\) { el = document.querySelector\\(`[placeholder=\"${field}\"], [name=\"${field}\"], #${CSS.escape\\(field\\)}`\\); }\n if \\(el\\) {\n el.value = value;\n el.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n el.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n results.push\\({ field, found: true, id: el.id, tag: el.tagName }\\);\n } else {\n results.push\\({ field, found: false }\\);\n }\n }\n return results;\n }, [{ field: 'Username', value: 'John Smith' }, { field: 'Password', value: '1234' }]\\);\n console.log\\('Fill results:', JSON.stringify\\(filled\\)\\);\n\n // Check values after fill\n const afterFill = await page.evaluate\\(\\(\\) => \\({\n u: document.getElementById\\('uname'\\).value,\n p: document.getElementById\\('pword'\\).value\n }\\)\\);\n console.log\\('After fill:', afterFill\\);\n\n // Click login button via JS evaluate \\(simulate fallback\\)\n const clicked = await page.evaluate\\(\\(\\) => {\n const buttons = document.querySelectorAll\\('button, input[type=\"button\"], input[type=\"submit\"]'\\);\n for \\(const btn of buttons\\) {\n const text = \\(btn.textContent || btn.innerText || btn.value || ''\\).trim\\(\\);\n if \\(text === 'Login'\\) { btn.click\\(\\); return true; }\n }\n return false;\n }\\);\n console.log\\('Button clicked:', clicked\\);\n\n // Check result\n const result = await page.evaluate\\(\\(\\) => \\({\n u: document.getElementById\\('uname'\\).value,\n p: document.getElementById\\('pword'\\).value,\n result: document.getElementById\\('result'\\).innerText\n }\\)\\);\n console.log\\('After click:', result\\);\n\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\nEOF\nnode /tmp/test_fill2.js)",
|
|
103
|
+
"Bash(node /tmp/test_fill2.js)",
|
|
104
|
+
"Bash(cp /tmp/test_fill2.js . && node test_fill2.js; rm test_fill2.js)",
|
|
105
|
+
"Bash(cat > test_press.js << 'EOF'\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({ headless: true, args: ['--no-sandbox','--disable-dev-shm-usage'] }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 } }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n\n // Simulate fill in the following \\(table-based, one evaluate call\\)\n await page.evaluate\\(\\(fillData\\) => {\n for \\(const { field, value } of fillData\\) {\n const label = Array.from\\(document.querySelectorAll\\('label'\\)\\).find\\(l => l.textContent.trim\\(\\) === field\\);\n let el = null;\n if \\(label && label.htmlFor\\) { el = document.getElementById\\(label.htmlFor\\); }\n if \\(!el && label\\) {\n const p = label.closest\\('p, div, td, li'\\);\n if \\(p\\) { const sib = p.nextElementSibling; if \\(sib\\) el = sib.querySelector\\('input, textarea'\\) || \\(sib.tagName === 'INPUT' || sib.tagName === 'TEXTAREA' ? sib : null\\); }\n }\n if \\(!el\\) { el = document.querySelector\\(`[placeholder=\"${field}\"], [name=\"${field}\"], #${CSS.escape\\(field\\)}`\\); }\n if \\(el\\) {\n el.value = value;\n el.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n el.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n }\n }\n }, [{ field: 'Username', value: 'John Smith' }, { field: 'Password', value: '1234' }]\\);\n\n const afterFill = await page.evaluate\\(\\(\\) => \\({\n u: document.getElementById\\('uname'\\).value,\n p: document.getElementById\\('pword'\\).value\n }\\)\\);\n console.log\\('After table fill:', afterFill\\);\n\n // Check if Playwright locator finds the Login button via hasText\n const locator = page.locator\\('button, input[type=\"button\"], input[type=\"submit\"], [role=\"button\"], .btn, a'\\)\n .filter\\({ hasText: /^Login$/ }\\);\n const count = await locator.count\\(\\);\n console.log\\('Locator count for Login:', count\\);\n \n if \\(count > 0\\) {\n const tag = await locator.first\\(\\).evaluate\\(el => el.tagName + ' type=' + el.type + ' value=' + el.value\\);\n console.log\\('Locator found:', tag\\);\n \n // Check values BEFORE Playwright click\n const beforeClick = await page.evaluate\\(\\(\\) => \\({\n u: document.getElementById\\('uname'\\).value,\n p: document.getElementById\\('pword'\\).value\n }\\)\\);\n console.log\\('Before Playwright click:', beforeClick\\);\n \n await locator.first\\(\\).click\\(\\);\n \n const afterClick = await page.evaluate\\(\\(\\) => \\({\n u: document.getElementById\\('uname'\\).value,\n p: document.getElementById\\('pword'\\).value,\n result: document.getElementById\\('result'\\).innerText\n }\\)\\);\n console.log\\('After Playwright click:', afterClick\\);\n }\n\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\nEOF\nnode test_press.js; rm test_press.js)",
|
|
106
|
+
"Bash(npm test 2>&1 | grep -A5 '\\\\[DEBUG\\\\]')",
|
|
107
|
+
"Bash(npm test 2>&1 | grep -A20 '\\\\[DEBUG')",
|
|
108
|
+
"Bash(npm test 2>&1 | tail -20)",
|
|
109
|
+
"Bash(npm test 2>&1 | grep -E '\\\\[DBG\\\\]|\\\\[DBG after\\\\]|\\\\[DBG catch\\\\]|fill in the following|✖.*should see.*John' | head -30)",
|
|
110
|
+
"Bash(npm test 2>&1 | tail -10)",
|
|
111
|
+
"Bash(cat > test_clear.js << 'EOF'\nconst { chromium } = require\\('playwright'\\);\n\\(async \\(\\) => {\n const browser = await chromium.launch\\({\n headless: true,\n args: ['--no-sandbox','--disable-dev-shm-usage','--disable-setuid-sandbox','--disable-web-security','--ignore-certificate-errors','--disable-extensions','--incognito','--disable-infobars'],\n }\\);\n const context = await browser.newContext\\({ viewport: { width: 1600, height: 1200 }, ignoreHTTPSErrors: true }\\);\n const page = await context.newPage\\(\\);\n await page.goto\\('http://localhost:8080/test--when--i-fill-in.html'\\);\n await page.waitForLoadState\\('domcontentloaded'\\);\n\n // Simulate table fill: set values in ONE evaluate\n console.log\\('\\\\n--- ONE evaluate, no events ---'\\);\n await page.evaluate\\(\\(\\) => {\n document.getElementById\\('uname'\\).value = 'John Smith';\n document.getElementById\\('pword'\\).value = '1234';\n }\\);\n let v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('Immediately after:', v\\);\n await page.waitForTimeout\\(300\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After 300ms:', v\\);\n\n // Reset\n await page.evaluate\\(\\(\\) => { document.getElementById\\('uname'\\).value = ''; document.getElementById\\('pword'\\).value = ''; }\\);\n await page.waitForTimeout\\(100\\);\n\n // Simulate table fill: set values in TWO evaluates with delay, no events\n console.log\\('\\\\n--- TWO evaluates, 300ms delay, no events ---'\\);\n await page.evaluate\\(\\(\\) => { document.getElementById\\('uname'\\).value = 'John Smith'; }\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After uname set:', v\\);\n await page.waitForTimeout\\(300\\);\n await page.evaluate\\(\\(\\) => { document.getElementById\\('pword'\\).value = '1234'; }\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After pword set:', v\\);\n await page.waitForTimeout\\(300\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After 300ms wait:', v\\);\n\n // Reset\n await page.evaluate\\(\\(\\) => { document.getElementById\\('uname'\\).value = ''; document.getElementById\\('pword'\\).value = ''; }\\);\n await page.waitForTimeout\\(100\\);\n\n // Simulate table fill: set values with events in ONE evaluate\n console.log\\('\\\\n--- ONE evaluate, WITH events ---'\\);\n await page.evaluate\\(\\(\\) => {\n const u = document.getElementById\\('uname'\\); const p = document.getElementById\\('pword'\\);\n u.value = 'John Smith';\n u.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n u.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n p.value = '1234';\n p.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n p.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n }\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('Immediately after:', v\\);\n await page.waitForTimeout\\(300\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After 300ms:', v\\);\n\n // Reset\n await page.evaluate\\(\\(\\) => { document.getElementById\\('uname'\\).value = ''; document.getElementById\\('pword'\\).value = ''; }\\);\n await page.waitForTimeout\\(100\\);\n\n // Simulate separate steps: TWO evaluates with events, large delay\n console.log\\('\\\\n--- TWO evaluates, 1000ms delay, WITH events ---'\\);\n await page.evaluate\\(\\(\\) => {\n const u = document.getElementById\\('uname'\\);\n u.value = 'John Smith';\n u.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n u.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n }\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After uname set:', v\\);\n await page.waitForTimeout\\(1000\\);\n await page.evaluate\\(\\(\\) => {\n const p = document.getElementById\\('pword'\\);\n p.value = '1234';\n p.dispatchEvent\\(new Event\\('input', { bubbles: true }\\)\\);\n p.dispatchEvent\\(new Event\\('change', { bubbles: true }\\)\\);\n }\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After pword set:', v\\);\n await page.waitForTimeout\\(300\\);\n v = await page.evaluate\\(\\(\\) => \\({u:document.getElementById\\('uname'\\).value, p:document.getElementById\\('pword'\\).value}\\)\\);\n console.log\\('After 300ms wait:', v\\);\n\n await browser.close\\(\\);\n}\\)\\(\\).catch\\(console.error\\);\nEOF\nnode test_clear.js; rm test_clear.js)",
|
|
112
|
+
"Bash(npx cucumber-js tests/features/test--when--i-fill-in.feature 2>&1 | tail -20)",
|
|
113
|
+
"Bash(npx cucumber-js tests/features/test--when--i-fill-in-table-by-attr.feature 2>&1 | tail -20)",
|
|
114
|
+
"Bash(cat cucumber.js 2>/dev/null || cat .cucumber.js 2>/dev/null || cat cucumber.yaml 2>/dev/null || ls *.js 2>/dev/null | head)",
|
|
115
|
+
"Bash(npx cucumber-js --no-config --require tests/support/world.js --require 'tests/step-definitions/**/*.js' tests/features/test--when--i-fill-in.feature 2>&1 | tail -20)",
|
|
116
|
+
"Bash(npx cucumber-js --require tests/support/world.js --require 'tests/step-definitions/**/*.js' tests/features/test--when--i-fill-in.feature 2>&1 | tail -20)",
|
|
117
|
+
"Bash(npm test 2>&1 | grep -E '\\\\[FILL end\\\\]|\\\\[PRESS start\\\\].*Login' | head -20)",
|
|
118
|
+
"Bash(npm test 2>&1 | grep -E \"✖|FAILED|AssertionError|PRESS start|FILL end\" 2>&1)",
|
|
119
|
+
"Bash(npm test 2>&1 | grep -E \"✖|AssertionError|Error:|FAILED\" | head -20)",
|
|
120
|
+
"Bash(npm test 2>&1 | grep -E \"FILL_|PRESS|✖ failed\" | head -20)",
|
|
121
|
+
"Bash(npm test 2>&1 | grep -E \"FILL_ATTR\" | head -20)",
|
|
122
|
+
"Bash(npx cucumber-js tests/features/test--when--i-fill-in-table-by-attr.feature 2>&1 | grep -E \"FILL_ATTR|✖|✔|pass|fail\" | head -30)",
|
|
123
|
+
"Bash(npx cucumber-js --tags \"@fill-in-table-by-attr or @scenario1\" tests/features/test--when--i-fill-in-table-by-attr.feature 2>&1 | head -50)",
|
|
124
|
+
"Bash(CUCUMBER_FEATURE_PATH=tests/features/test--when--i-fill-in-table-by-attr.feature npx cucumber-js tests/features/test--when--i-fill-in-table-by-attr.feature --no-strict 2>&1 | head -80)",
|
|
125
|
+
"Bash(cat /var/www/html/products/webship-js-playwright2/webship-js/cucumber.js 2>/dev/null || cat /var/www/html/products/webship-js-playwright2/webship-js/.cucumber* 2>/dev/null || cat /var/www/html/products/webship-js-playwright2/webship-js/package.json | grep -A5 cucumber)",
|
|
126
|
+
"Bash(node /tmp/test_table_fill.js)",
|
|
127
|
+
"Bash(cp /tmp/test_table_fill.js /var/www/html/products/webship-js-playwright2/webship-js/ && node test_table_fill.js && rm test_table_fill.js)",
|
|
128
|
+
"Bash(npm test 2>&1 | grep -E \"DBG row|FILL_ATTR end|FILL_LABEL end\" | head -30)",
|
|
129
|
+
"Bash(npm test 2>&1 | grep \"DBG row0\" | head -20)",
|
|
130
|
+
"Bash(npm test 2>&1 | grep -E \"DBG row|FILL_ATTR end|FILL_LABEL end|scenarios.*fail\" | head -20)",
|
|
131
|
+
"Bash(npm test 2>&1 | tail -8)"
|
|
8
132
|
]
|
|
9
133
|
}
|
|
10
134
|
}
|
|
@@ -8,29 +8,9 @@ jobs:
|
|
|
8
8
|
|
|
9
9
|
env:
|
|
10
10
|
TEST_BASE_URL: http://localhost:8080
|
|
11
|
-
SELENIUM_HOST: http://localhost:4444/wd/hub
|
|
12
11
|
FORCE_COLOR: "1"
|
|
13
12
|
|
|
14
13
|
steps:
|
|
15
|
-
- name: Install/Update Google Chrome browser
|
|
16
|
-
run: |
|
|
17
|
-
sudo apt install libu2f-udev
|
|
18
|
-
sudo apt-get install libappindicator3-1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils
|
|
19
|
-
export CHROME_BIN=/usr/bin/google-chrome
|
|
20
|
-
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
21
|
-
sudo dpkg -i google-chrome-stable_current_amd64.deb
|
|
22
|
-
rm google-chrome-stable_current_amd64.deb
|
|
23
|
-
|
|
24
|
-
- name: Install/Update Chrome Driver
|
|
25
|
-
run: |
|
|
26
|
-
CHROME_VERSION=$(google-chrome --product-version);
|
|
27
|
-
echo $CHROME_VERSION;
|
|
28
|
-
wget https://storage.googleapis.com/chrome-for-testing-public/$CHROME_VERSION/linux64/chromedriver-linux64.zip
|
|
29
|
-
unzip chromedriver-linux64.zip
|
|
30
|
-
sudo chmod +x chromedriver-linux64/chromedriver
|
|
31
|
-
sudo mv -f chromedriver-linux64/chromedriver /usr/bin/
|
|
32
|
-
rm -rf chromedriver-linux64.zip chromedriver-linux64
|
|
33
|
-
|
|
34
14
|
- name: Checkout repository
|
|
35
15
|
uses: actions/checkout@v3
|
|
36
16
|
|
|
@@ -39,27 +19,17 @@ jobs:
|
|
|
39
19
|
with:
|
|
40
20
|
node-version: '20.x'
|
|
41
21
|
|
|
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
|
-
|
|
47
|
-
- name: Run Selenium Standalone server
|
|
48
|
-
run: |
|
|
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
22
|
- name: Install dependencies
|
|
54
23
|
run: npm install
|
|
55
24
|
|
|
56
|
-
- name:
|
|
57
|
-
run:
|
|
25
|
+
- name: Install Playwright browsers
|
|
26
|
+
run: npx playwright install --with-deps chromium
|
|
58
27
|
|
|
59
28
|
- name: Start virtual server
|
|
60
|
-
run:
|
|
61
|
-
|
|
62
|
-
|
|
29
|
+
run: npm start &
|
|
30
|
+
|
|
31
|
+
- name: Wait for server
|
|
32
|
+
run: sleep 3
|
|
63
33
|
|
|
64
34
|
- name: Run tests
|
|
65
|
-
run: npm test
|
|
35
|
+
run: npm test
|
package/.gitlab-ci.yml
CHANGED
|
@@ -1,50 +1,26 @@
|
|
|
1
|
-
image:
|
|
2
|
-
|
|
3
|
-
services:
|
|
4
|
-
- name: selenium/standalone-chrome
|
|
5
|
-
alias: selenium
|
|
1
|
+
image: node:20
|
|
6
2
|
|
|
7
3
|
variables:
|
|
8
|
-
NODE_OPTIONS: "--openssl-legacy-provider"
|
|
9
4
|
FORCE_COLOR: "1"
|
|
10
5
|
|
|
11
6
|
before_script:
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
- sudo apt-get update
|
|
19
|
-
- sudo apt-get install -y openjdk-11-jre openjdk-11-jre-headless openjdk-11-jdk openjdk-11-jdk-headless
|
|
20
|
-
- sudo apt-get install -y libu2f-udev
|
|
21
|
-
- sudo apt-get install -y libappindicator1 fonts-liberation libgbm1 libgtk-3-0 xdg-utils
|
|
22
|
-
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
23
|
-
- sudo dpkg -i google-chrome-stable_current_amd64.deb
|
|
24
|
-
- rm google-chrome-stable_current_amd64.deb
|
|
25
|
-
- CHROME_VERSION=$(google-chrome --product-version)
|
|
26
|
-
- wget https://storage.googleapis.com/chrome-for-testing-public/$CHROME_VERSION/linux64/chromedriver-linux64.zip
|
|
27
|
-
- unzip chromedriver-linux64.zip
|
|
28
|
-
- sudo chmod +x chromedriver-linux64/chromedriver
|
|
29
|
-
- sudo mv -f chromedriver-linux64/chromedriver /usr/bin/
|
|
30
|
-
- rm -rf chromedriver-linux64.zip chromedriver-linux64
|
|
31
|
-
|
|
7
|
+
- apt-get update -qq
|
|
8
|
+
- apt-get upgrade -qqy
|
|
9
|
+
- 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
|
|
10
|
+
- npm install
|
|
11
|
+
- npx playwright install --with-deps chromium
|
|
12
|
+
|
|
32
13
|
stages:
|
|
33
|
-
- build
|
|
34
14
|
- test
|
|
35
15
|
|
|
36
|
-
webship-js-
|
|
37
|
-
stage:
|
|
16
|
+
webship-js-test:
|
|
17
|
+
stage: test
|
|
38
18
|
script:
|
|
39
|
-
- wget https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.4.0/selenium-server-4.4.0.jar
|
|
40
|
-
- nohup java -jar selenium-server-4.4.0.jar standalone > selenium.log 2>&1 &
|
|
41
|
-
- npm install
|
|
42
|
-
- node webship-init -ci circleci -os linux -b chrome
|
|
43
|
-
- export NODE_OPTIONS=--openssl-legacy-provider
|
|
44
19
|
- npm start &
|
|
20
|
+
- sleep 3
|
|
45
21
|
- npm test
|
|
46
22
|
|
|
47
23
|
only:
|
|
48
24
|
refs:
|
|
49
25
|
- tags
|
|
50
|
-
- branches
|
|
26
|
+
- branches
|
package/.travis-ci.yml
CHANGED
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
language: node_js
|
|
2
|
+
|
|
3
|
+
node_js:
|
|
4
|
+
- "20"
|
|
5
|
+
|
|
7
6
|
before_script:
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
7
|
+
- npm install
|
|
8
|
+
- npx playwright install --with-deps chromium
|
|
9
|
+
|
|
11
10
|
script:
|
|
12
|
-
-
|
|
13
|
-
|
|
11
|
+
- npm start &
|
|
12
|
+
- npm test
|
|
13
|
+
|
|
14
14
|
cache:
|
|
15
15
|
directories:
|
|
16
|
-
-
|
|
17
|
-
- $HOME/.m2
|
|
18
|
-
|
|
19
|
-
deploy:
|
|
20
|
-
provider: releases
|
|
21
|
-
api_key: ${api_key}
|
|
22
|
-
skip_cleanup: true
|
|
23
|
-
file: [ "target/surefire-reports/emailable-report.html",
|
|
24
|
-
"target/surefire-reports/index.html" ]
|
|
25
|
-
on:
|
|
26
|
-
all_branches: true
|
|
27
|
-
tags: false
|
|
16
|
+
- node_modules
|
package/.travis.yml
ADDED
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Webship JS
|
|
2
2
|
|
|
3
|
-
[](https://github.com/webship/webship-js/actions)
|
|
4
|
+
[](https://gitlab.com/webship/webship-js/-/pipelines)
|
|
5
|
+
[](https://circleci.com/gh/webship/webship-js/tree/2.0.x)
|
|
6
|
+
[](https://bitbucket.org/webshipco/webship-js/pipelines)
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Webship-js is an Automated Functional Acceptance Testing tool. Helps to ease and speed the work with the End-to-end testing features in web apps or projects. Utilizing [
|
|
9
|
+
Webship-js is an Automated Functional Acceptance Testing tool. Helps to ease and speed the work with the End-to-end testing features in web apps or projects. Utilizing [Playwright](https://playwright.dev) and [Cucumber-js](https://github.com/cucumber/cucumber-js). Having custom and advanced general step definitions.
|
|
10
10
|
|
|
11
11
|
### Webship-js Documentations
|
|
12
|
-
All you need to know is at [webship-js Docs](https://webship.co/docs/webship-js/
|
|
12
|
+
All you need to know is at [webship-js Docs](https://webship.co/docs/webship-js/2.0.x).
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
## Install webship-js using npm
|
|
@@ -21,11 +21,11 @@ npm install webship-js
|
|
|
21
21
|
## Install files required by the webship-js tool
|
|
22
22
|
|
|
23
23
|
```
|
|
24
|
-
bash <(wget -O - https://raw.githubusercontent.com/webship/wbash/v1/webship-js/
|
|
24
|
+
bash <(wget -O - https://raw.githubusercontent.com/webship/wbash/v1/webship-js/v2/template.sh)
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Automated Functional Acceptance Testing
|
|
28
28
|
|
|
29
29
|
```
|
|
30
30
|
npm test
|
|
31
|
-
```
|
|
31
|
+
```
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -4,15 +4,11 @@ pipelines:
|
|
|
4
4
|
default:
|
|
5
5
|
- step:
|
|
6
6
|
name: Install and Test
|
|
7
|
-
services:
|
|
8
|
-
- selenium
|
|
9
7
|
caches:
|
|
10
8
|
- node
|
|
11
9
|
script:
|
|
12
10
|
- npm install
|
|
11
|
+
- npx playwright install --with-deps chromium
|
|
12
|
+
- npm start &
|
|
13
|
+
- sleep 3
|
|
13
14
|
- FORCE_COLOR=1 npm test
|
|
14
|
-
|
|
15
|
-
definitions:
|
|
16
|
-
services:
|
|
17
|
-
selenium:
|
|
18
|
-
image: selenium/standalone-chrome:latest
|