Skip to content

Commit 59c0fed

Browse files
authored
Merge branch '4.x' into add-3.x-commits
2 parents b3b9dec + 9cda907 commit 59c0fed

File tree

5 files changed

+4
-37
lines changed

5 files changed

+4
-37
lines changed

lib/helper/Puppeteer.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2945,35 +2945,6 @@ async function findElements(matcher, locator) {
29452945
return []
29462946
}
29472947

2948-
/**
2949-
* Find a single element using Puppeteer's native element discovery methods
2950-
* Note: Puppeteer Locator API doesn't have .first() method like Playwright
2951-
* @param {Object} matcher - Puppeteer context to search within
2952-
* @param {Object|string} locator - Locator specification
2953-
* @returns {Promise<Object>} Single ElementHandle object
2954-
*/
2955-
async function findElement(matcher, locator) {
2956-
if (locator.react) return findReactElements.call(this, locator)
2957-
locator = new Locator(locator, 'css')
2958-
2959-
// Check if locator is a role locator and call findByRole
2960-
if (locator.isRole()) {
2961-
const elements = await findByRole.call(this, matcher, locator)
2962-
return elements[0]
2963-
}
2964-
2965-
// Use proven legacy approach - Puppeteer Locator API doesn't have .first() method
2966-
if (!locator.isXPath()) {
2967-
const elements = await matcher.$$(locator.simplify())
2968-
return elements[0]
2969-
}
2970-
2971-
// For XPath in Puppeteer 24.x+, use the same approach as findElements
2972-
// $x method was removed, so we use ::-p-xpath() or fallback
2973-
const elements = await findElements.call(this, matcher, locator)
2974-
return elements[0]
2975-
}
2976-
29772948
/**
29782949
* Find a single element using Puppeteer's native element discovery methods
29792950
* Note: Puppeteer Locator API doesn't have .first() method like Playwright

test/data/sandbox/configs/html-reporter-plugin/features/html-reporter.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Feature: HTML Reporter BDD Test
1313
When I perform an action
1414
Then I should see the expected result
1515
And everything should work correctly
16+
But I should see the expected result
1617

1718
@regression @critical
1819
Scenario: Test with data table

test/runner/html-reporter-plugin_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe('CodeceptJS html-reporter-plugin', function () {
183183
expect(reportContent).toContain('data-type=')
184184

185185
// Should contain scenario steps with proper keywords
186-
expect(reportContent).toMatch(/Given|When|Then|And/)
186+
expect(reportContent).toMatch(/Given|When|Then|And|But/)
187187

188188
done()
189189
})

test/unit/plugin/screenshotOnFail_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ describe('screenshotOnFail', () => {
6868
await recorder.promise()
6969
expect(screenshotSaved.called).is.ok
7070
const fileName = screenshotSaved.getCall(0).args[0]
71-
const regexpFileName = /test1_[0-9]{13}.failed.png/
71+
const regexpFileName = /test1_[0-9]{10}.failed.png/
72+
7273
expect(fileName.match(regexpFileName).length).is.equal(1)
7374
})
7475

typings/index.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,3 @@ declare module 'codeceptjs/effects' {
648648
export const retryTo: RetryTo
649649
export const hopeThat: HopeThat
650650
}
651-
652-
declare module 'codeceptjs/effects' {
653-
export const tryTo: TryTo
654-
export const retryTo: RetryTo
655-
export const hopeThat: HopeThat
656-
}

0 commit comments

Comments
 (0)