Skip to content

Commit ee73379

Browse files
authored
chore(ci): fix assertions in e2e tests (#3316)
Changes from #3267 change the web layout on crawlee.dev and broke the selectors in multiple e2e tests. This PR updates these selectors to match the current state of the web. This also pins the @types/node dependency in TS E2E tests to ^24.0.0.
1 parent 37b6602 commit ee73379

File tree

10 files changed

+20
-13
lines changed

10 files changed

+20
-13
lines changed

test/e2e/cheerio-curl-impersonate-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
},
2525
"devDependencies": {
2626
"@apify/tsconfig": "^0.1.0",
27-
"typescript": "^5.0.0"
27+
"typescript": "^5.0.0",
28+
"@types/node": "^24.0.0"
2829
},
2930
"scripts": {
3031
"start": "tsc && node main.js",

test/e2e/cheerio-default-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@apify/tsconfig": "^0.1.0",
26-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@types/node": "^24.0.0"
2728
},
2829
"scripts": {
2930
"start": "tsc && node main.js",

test/e2e/cheerio-impit-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
},
2525
"devDependencies": {
2626
"@apify/tsconfig": "^0.1.0",
27-
"typescript": "^5.0.0"
27+
"typescript": "^5.0.0",
28+
"@types/node": "^24.0.0"
2829
},
2930
"scripts": {
3031
"start": "tsc && node main.js",

test/e2e/cheerio-max-requests/actor/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ await Actor.main(async () => {
3434
}
3535
} else if (label === 'DETAIL') {
3636
const uniqueIdentifier = url.split('/').slice(-2).join('/');
37-
const title = $('header h1').text();
38-
const firstParagraph = $('header + p').text();
37+
const title = $('.markdown h1').text();
38+
const firstParagraph = $('.markdown > p').text();
3939
const modifiedDate = $('.theme-last-updated time').attr('datetime');
4040

4141
await Dataset.pushData({

test/e2e/cheerio-page-info/actor/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ router.addHandler('DETAIL', async ({ request, $ }) => {
2222
const { url } = request;
2323

2424
const uniqueIdentifier = url.split('/').slice(-2).join('/');
25-
const title = $('header h1').text();
26-
const firstParagraph = $('header + p').text();
25+
const title = $('.markdown h1').text();
26+
const firstParagraph = $('.markdown > p').text();
2727
const modifiedDate = $('.theme-last-updated time').attr('datetime');
2828

2929
await Dataset.pushData({

test/e2e/cheerio-stop-resume-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@apify/tsconfig": "^0.1.0",
26-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@types/node": "^24.0.0"
2728
},
2829
"scripts": {
2930
"start": "tsc && node main.js",

test/e2e/jsdom-default-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@apify/tsconfig": "^0.1.0",
26-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@types/node": "^24.0.0"
2728
},
2829
"scripts": {
2930
"start": "tsc && node main.js",

test/e2e/jsdom-react-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@apify/tsconfig": "^0.1.0",
26-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@types/node": "^24.0.0"
2728
},
2829
"scripts": {
2930
"start": "tsc && node main.js",

test/e2e/linkedom-default-ts/actor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
},
2424
"devDependencies": {
2525
"@apify/tsconfig": "^0.1.0",
26-
"typescript": "^5.0.0"
26+
"typescript": "^5.0.0",
27+
"@types/node": "^24.0.0"
2728
},
2829
"scripts": {
2930
"start": "tsc && node main.js",

test/e2e/puppeteer-page-info/actor/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ await Actor.main(async () => {
3333

3434
const uniqueIdentifier = url.split('/').slice(-2).join('/');
3535

36-
const titleP = page.$eval('header h1', (el) => el.textContent);
37-
const firstParagraphP = page.$eval('header + p', (el) => el.textContent);
36+
const titleP = page.$eval('.markdown h1', (el) => el.textContent);
37+
const firstParagraphP = page.$eval('.markdown > p', (el) => el.textContent);
3838
const modifiedDateP = page.$eval('.theme-last-updated time', (el) => el.getAttribute('datetime'));
3939
const [title, description, modifiedDate] = await Promise.all([titleP, firstParagraphP, modifiedDateP]);
4040

0 commit comments

Comments
 (0)