-
-
Notifications
You must be signed in to change notification settings - Fork 736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: switchTo - within block #3892
Conversation
@kobenguyent I replaced However one of my tests (using the helper Pixelmatcher methods in an iframe) is failing with the error
The scenario is Scenario("Verify the game (stone) is not finished", () => {
within(
{
frame: HtmlBodyPage.iFrame, // "(//iframe)[last()]"
},
() => {
konvajsFragment.verifyLessonPathArea("Lesson_Path_Initial");
}
);
}); |
It looks like a different issue than the original ones. However it's related to |
my simple test looked good! Not sure if you have any special setup. 🤔
|
@kobenguyent This test passes in 3.5.3 and 3.5.5, but doesn't pass in the branch Config: export const config: CodeceptJS.MainConfig = {
tests: "./*_test.ts",
output: "./output",
helpers: {
Playwright: {
browser: "chromium",
url: "http://localhost",
show: true,
},
PixelmatchHelper: {
require: "codeceptjs-pixelmatchhelper",
dirExpected: "./screenshots/base/",
dirDiff: "./screenshots/diff/",
},
},
name: "my",
}; Test: Feature("My");
Scenario("test something", ({ I }) => {
I.amOnPage(
"https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe"
);
I.click("#accept-choices");
I.wait(5); // Wait for Google ads to be loaded
within(
{
frame: "iframe#iframeResult",
},
() => {
I.takeScreenshot("screenshot.png", "actual", "h1");
}
);
}); Output:
|
May you check your code to see if you are using the correct branch?
|
@kobenguyent Maybe it's a deployment issue on my side. I copied "Playwright.js" from current |
"codeceptjs": "github:codeceptjs/codeceptjs#fix-switchTo", I installed the branch directly. |
Tried again, with latest "3.x" in a fork of the repo |
Perhaps your issue would be fixed with this #3918 |
could you please let me know, in which version this fix will be included? We are pinned to 3.5.3 because of this. 3.5.6? |
hey @BenjaminHoch-GoTo sorry for the confusion! |
Yeah i just tried out 3.5.6 and still get "context.waitForSelector is not a function" . We'll wait then. |
Yes, just tried my production test that originally failed on This is how the simple test looks with 20 sec. timeout: My --
[1] Starting recording promises
Timeouts:
› [Session] Starting singleton browser session
test something
I am on page "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe"
I click "#accept-choices"
I wait 5
› [Browser:Error] Failed to load resource: the server responded with a status of 400 (Bad Request)
› [Browser:Error] %cAdConsent display: inline-block; color: #fff; background: #ff0000; padding: 1px 4px; border-radius: 3px; ERROR: Unknown __tcfapi() API call 'getInAppTCData'%cAdConsent display: inline-block; color: #fff; background: #ff0000; padding: 1px 4px; border-radius: 3px; ERROR: Unknown __tcfapi() API call 'getInAppTCData'
Within "{"frame":"iframe#iframeResult"}" ""
I take screenshot "screenshot.png", "actual", "h1"
› [Browser:Error] Failed to load resource: the server responded with a status of 400 (Bad Request)
✔ OK in 26648ms
OK | 1 passed // 28s |
@kobenguyent Looks good, it works well as with 3.5.3. Thanks! |
I have suspicion that |
I guess this covers your issue. #3984 |
@kobenguyent Confirmed. It fixes my issue, thanks. |
Motivation/Description of the PR
Applicable helpers:
Type of change
Checklist:
npm run docs
)npm run lint
)npm test
)