Closed BenjaminHoch-GoTo closed 9 months ago
Hi, we are blocked from upgrading from 3.5.3 to a newer version. The initial issue was reported here: https://github.com/codeceptjs/CodeceptJS/pull/3892
We just try to upgrade to the current version to stay up to date.
After 3.5.7 and also with 3.5.8 we now get the following error:
locator.isHidden: Error: Selector "[prefix="/inventory"]" resolved to <app-gap features="{}" id="inventory" fragments="[]" lang…></app-gap>, <iframe> was expected Call log: - checking visibility of frameLocator('[prefix="/inventory"]').frameLocator('iframe').locator('//chameleon-skeleton[@variant="square"]').first()
in the dom the is actually inside a shadow dom of a <app-gap ...> tag. this is something we can't control, because we are a module. but technically it is an iframe. downgrading to 3.5.3 again, results in tests to pass successfully.
Provide test source code if related
we use this in a before each hook:
setIframe() { this.amOnPage('/inventory') this.switchTo('[prefix="/inventory"]') this.switchTo('iframe') },
after setting the iframe we call this:
waitForMainPageToBeVisible() { // wait or loading animation to disappear I().wait(3) I().waitForInvisible('//chameleon-skeleton[@variant="square"]', 60) I().wait(2) },
export const config: CodeceptJS.MainConfig = { tests: './src/tests/**/*.test.ts', grep: getTestFilterExpression(), output: './output', helpers: { Playwright: { url, show: true, browser: 'chromium', timeout: 30000, waitForTimeout: 30000, waitForNavigation: 'load', video: true, keepVideoForPassedTests: true, }, PlaywrightVideoAllure: { require: './helpers/playwright_videoAllure.ts', }, }, include: { I: './steps_file', }, name: 'e2e-tests-codecept', plugins: { pauseOnFail: {}, retryFailedStep: { enabled: true, }, tryTo: { enabled: true, }, screenshotOnFail: { enabled: true, }, allure: { require: '@codeceptjs/allure-legacy', screenshotsForAllureReport: true, }, FileSystem: {}, autoLogin: { enabled: true, saveToFile: false, inject: 'loginAs', users: { admin: { login: (I: { signIn: () => unknown }) => I.signIn(), }, userLive: { login: (I: { signIn: () => 'testaccount@email.com' }) => I.signIn(), }, }, }, registerGlobal: true, }, bootstrap: () => { return new Promise<void>(() => { container.share({ lockedUsers: new Set() }, false) }) }, }
i fixed this, by changing the selector to this.switchTo("iframe[title='inventory']")
this.switchTo("iframe[title='inventory']")
What are you trying to achieve?
Hi, we are blocked from upgrading from 3.5.3 to a newer version. The initial issue was reported here: https://github.com/codeceptjs/CodeceptJS/pull/3892
We just try to upgrade to the current version to stay up to date.
What do you get instead?
After 3.5.7 and also with 3.5.8 we now get the following error:
in the dom the
we use this in a before each hook:
after setting the iframe we call this:
Details