Skip to content

<iframe> was expected, prevents further execution #4012

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

Closed
BenjaminHoch-GoTo opened this issue Nov 20, 2023 · 1 comment
Closed

<iframe> was expected, prevents further execution #4012

BenjaminHoch-GoTo opened this issue Nov 20, 2023 · 1 comment

Comments

@BenjaminHoch-GoTo
Copy link

BenjaminHoch-GoTo commented Nov 20, 2023

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: #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:

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 <iframe> 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)
  },

Details

  • CodeceptJS version: 3.5.8
  • NodeJS Version: 20.9.0
  • Operating System: linux, mac os
  • puppeteer || webdriverio || testcafe version (if related)
  • Configuration file:
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: () => '[email protected]' }) => I.signIn(),
        },
      },
    },
    registerGlobal: true,
  },
  bootstrap: () => {
    return new Promise<void>(() => {
      container.share({ lockedUsers: new Set() }, false)
    })
  },
}
@BenjaminHoch-GoTo
Copy link
Author

i fixed this, by changing the selector to
this.switchTo("iframe[title='inventory']")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant