Skip to content

Commit 6dbe76a

Browse files
committed
package & version updates + minor adjustments for deprecations
1 parent 7238025 commit 6dbe76a

File tree

5 files changed

+34
-35
lines changed

5 files changed

+34
-35
lines changed

.github/workflows/test-parallel.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
container:
11-
image: node:19
11+
image: node:20
1212

1313
strategy:
1414
fail-fast: false
@@ -21,16 +21,16 @@ jobs:
2121
options: --shm-size=2gb
2222

2323
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/setup-node@v3
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
2626
with:
27-
node-version: '19'
27+
node-version: '20'
2828
cache: 'npm'
2929
- run: npm ci
3030
- run: npm run test
3131
env:
3232
BROWSER: ${{ matrix.browser }}
33-
- uses: actions/upload-artifact@v3
33+
- uses: actions/upload-artifact@v4
3434
if: always()
3535
with:
3636
name: ${{ matrix.browser }}

.github/workflows/test-single.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
container:
21-
image: node:19
21+
image: node:20
2222

2323
services:
2424
selenium:
2525
image: selenium/standalone-${{ github.event.inputs.browser }}
2626
options: --shm-size=2gb
2727

2828
steps:
29-
- uses: actions/checkout@v3
30-
- uses: actions/setup-node@v3
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-node@v4
3131
with:
32-
node-version: '19'
32+
node-version: '20'
3333
cache: 'npm'
3434
- run: npm ci
3535
- run: npm run test
3636
env:
3737
BROWSER: ${{ github.event.inputs.browser }}
38-
- uses: actions/upload-artifact@v3
38+
- uses: actions/upload-artifact@v4
3939
if: always()
4040
with:
4141
name: screenshots

.github/workflows/test-testmo.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
container:
11-
image: node:19
11+
image: node:20
1212

1313
strategy:
1414
fail-fast: false
@@ -21,10 +21,10 @@ jobs:
2121
options: --shm-size=2gb
2222

2323
steps:
24-
- uses: actions/checkout@v3
25-
- uses: actions/setup-node@v3
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
2626
with:
27-
node-version: '19'
27+
node-version: '20'
2828
cache: 'npm'
2929
- run: npm ci
3030

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"scripts": {
3-
"test": "npx mocha test.mjs",
4-
"test-junit": "npx mocha --reporter node_modules/mocha-junit-reporter --reporter-options jenkinsMode=1,outputs=1,mochaFile=results/mocha-test-results.xml test.mjs",
5-
"test-report": "npx testmo automation:run:submit --instance '$TESTMO_URL' --project-id 1 --name 'Selenium test run for \"$BROWSER\"' --source 'frontend' --results results/*.xml",
6-
"test-ci": "npx testmo automation:run:submit --instance '$TESTMO_URL' --project-id 1 --name 'Selenium test run for \"$BROWSER\"' --source 'frontend' --results results/*.xml -- npm run test-junit"
7-
},
8-
"devDependencies": {
9-
"@testmo/testmo-cli": "^1.2.0",
10-
"chai": "^4.3.7",
11-
"mocha": "^10.2.0",
12-
"mocha-junit-reporter": "^2.2.0",
13-
"selenium-webdriver": "^4.8.0"
14-
}
15-
}
2+
"scripts": {
3+
"test": "npx mocha test.mjs",
4+
"test-junit": "npx mocha --reporter node_modules/mocha-junit-reporter --reporter-options jenkinsMode=1,outputs=1,mochaFile=results/mocha-test-results.xml test.mjs",
5+
"test-report": "npx testmo automation:run:submit --instance '$TESTMO_URL' --project-id 1 --name 'Selenium test run for \"$BROWSER\"' --source 'frontend' --results results/*.xml",
6+
"test-ci": "npx testmo automation:run:submit --instance '$TESTMO_URL' --project-id 1 --name 'Selenium test run for \"$BROWSER\"' --source 'frontend' --results results/*.xml -- npm run test-junit"
7+
},
8+
"devDependencies": {
9+
"@testmo/testmo-cli": "^1.2.0",
10+
"chai": "^4.3.7",
11+
"mocha": "^10.8.2",
12+
"mocha-junit-reporter": "^2.2.0",
13+
"selenium-webdriver": "^4.28.1"
14+
}
15+
}

test.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe('search', async function () {
66
this.timeout(10000);
77
let driver;
88

9-
if (!fs.existsSync('./screenshots')){
9+
if (!fs.existsSync('./screenshots')) {
1010
fs.mkdirSync('./screenshots');
1111
}
1212

@@ -15,26 +15,25 @@ describe('search', async function () {
1515
// Automate DuckDuckGo search
1616
await driver.get('https://duckduckgo.com/');
1717
const searchBox = await driver.findElement(
18-
By.id('search_form_input_homepage'));
18+
By.id('searchbox_input'));
1919
await searchBox.sendKeys(term, Key.ENTER);
2020

2121
// Wait until the result page is loaded
22-
await driver.wait(until.elementLocated(By.css('#links .result')));
22+
await driver.wait(until.elementLocated(By.css('#more-results')));
2323

2424
// Return page content
25-
const body = await driver.findElement(By.tagName('body'));
26-
return await body.getText();
25+
return await driver.getPageSource();
2726
};
2827

2928
// Make sure the BROWSER env variable is set
30-
before(async function() {
29+
before(async function () {
3130
if (!process.env.BROWSER) {
3231
throw new Error('No BROWSER environment variable set')
3332
}
3433
});
3534

3635
// Before each test, initialize Selenium and launch the browser
37-
beforeEach(async function() {
36+
beforeEach(async function () {
3837
// Microsoft uses a longer name for Edge
3938
let browser = process.env.BROWSER;
4039
if (browser == 'edge') {

0 commit comments

Comments
 (0)