Skip to content

Commit aa022c6

Browse files
author
DavertMik
committed
fixed webdriver tests
1 parent b81dac1 commit aa022c6

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
4949
- name: run chromium unit tests
5050
run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000 --reporter @testomatio/reporter/mocha
51-
timeout-minutes: 5
51+
timeout-minutes: 10
5252
- name: run chromium tests
5353
run: 'timeout 600 bash -c "unset BROWSER && BROWSER=chromium ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug"'
5454
timeout-minutes: 12

.github/workflows/puppeteer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- run: chrome --version
4343
- name: run unit tests
4444
run: ./node_modules/.bin/mocha test/helper/Puppeteer_test.js --reporter @testomatio/reporter/mocha
45-
timeout-minutes: 5
45+
timeout-minutes: 10
4646
- name: run tests
4747
run: 'timeout 600 bash -c "./bin/codecept.js run-workers 2 -c test/acceptance/codecept.Puppeteer.js --grep @Puppeteer --debug"'
4848
timeout-minutes: 12

.github/workflows/webdriver.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
node-version: [20.x]
2323

2424
steps:
25-
- run: docker run -d --net=host --shm-size=2g selenium/standalone-chrome:4.27
25+
- run: docker run -d -p 4444:4444 --shm-size=2g selenium/standalone-chrome:4.27
2626
- uses: actions/checkout@v4
2727
- name: Use Node.js ${{ matrix.node-version }}
2828
uses: actions/setup-node@v4
@@ -41,7 +41,7 @@ jobs:
4141
run: 'php -S 127.0.0.1:8000 -t test/data/app &'
4242
- name: run unit tests
4343
run: ./node_modules/.bin/mocha test/helper/WebDriver_test.js --exit --reporter @testomatio/reporter/mocha
44-
timeout-minutes: 5
44+
timeout-minutes: 10
4545
- name: check
4646
run: './bin/codecept.js check -c test/acceptance/codecept.WebDriver.js'
4747
timeout-minutes: 2

lib/helper/WebDriver.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ class WebDriver extends Helper {
656656
}
657657

658658
async _before() {
659+
if (!webdriverio) await this._init()
659660
this.context = this.root
660661
if (this.options.restart && !this.options.manualStart) return this._startBrowser()
661662
if (!this.isRunning && !this.options.manualStart) return this._startBrowser()
@@ -854,7 +855,7 @@ class WebDriver extends Helper {
854855
* @param {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator.
855856
*/
856857
async _locate(locator, smartWait = false) {
857-
if (require('../store').debugMode) smartWait = false
858+
if (store.debugMode) smartWait = false
858859

859860
// special locator type for Shadow DOM
860861
if (this._isShadowLocator(locator)) {

0 commit comments

Comments
 (0)