Skip to content

<iframe> was expected, prevents further execution #4012

@BenjaminHoch-GoTo

Description

@BenjaminHoch-GoTo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions