swithTo/within not swith to iframe

オープン
#4,414 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, nodejs
領域
testing-qa

調査の方向性

まず、提供された Puppeteer フローを CodeceptJS 3.6 で再現し、提供された iframe セレクターを使った switchTo、within、waitForElement に重点を置きます。CodeceptJS 3.4.1 と動作を比較し、失敗を切り分けられたらリグレッションカバレッジを追加します。完了条件は、iframe 入力セレクターが解決され、提供されたシーケンスが完了することです。

索引モデルが issue の本文から書いたものです。

説明

stale
What are you trying to achieve?

After update codeceptjs, I can't get input in iframe. I just try using switchTo and within. My code work on codecept 3.4.1

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

      I wait for visible "[data-marker=new-card]", 5
      I click "[data-marker=new-card]"
      I wait for element "[data-marker=iframe]", 5
      I switch to "[data-marker=iframe]"
      I wait for element "[id=pan]", 5
      › [Browser:Warning] 
    [1]  Error (Non-Terminated) | Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded | (err) => { step.status = 'failed'; step.endTime = ...
    [1] Error | Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded undefined...
    [1] <teardown>  Stopping recording promises

...
     Error: element ([id=pan]) still not present on page after 5 sec
Waiting for selector `[id=pan]` failed: Waiting failed: 5000ms exceeded

Provide test source code if related

    await I.waitForElement(this.iframe, FRONT_TIMEOUT_SEC);
    await I.switchTo(this.iframe);
    await I.waitForElement(this.cardNumberInput, FRONT_TIMEOUT_SEC);
    await I.waitForVisible(this.cardNumberInput, FRONT_TIMEOUT_SEC);
    await I.fillField(this.cardNumberInput, creditCard.cardNumber);
    await I.fillField(this.expDateInput, creditCard.expDate);
    await I.fillField(this.cvcInput, creditCard.cvv);
    await I.switchTo();
Details
  • CodeceptJS version: 3.6
  • NodeJS Version: 18.16.1
  • Operating System: mac os
  • puppeteer || webdriverio || testcafe version (if related)
  • Configuration file:
exports.config = {
  fullPromiseBased: true,
  tests: testsPath,
  output: `${pwd}/output`,
  bootstrap: () => {
    global.codecept_dir = pwd;
  },
  name: 'xxx',
  helpers: {
    Puppeteer: {
      show: true,
      waitForNavigation: 'networkidle2',
      waitForTimeout: 30000,
      getPageTimeout: 30000,
      windowSize: '1000x1000',
      browser: 'chrome',
      chrome: {
        args: ['--no-sandbox',
          '--window-size=1920,1000',
          '--disable-setuid-sandbox',
          '--disable-web-security',
          // workaround for iframe in {headless: false} mode,
          // see details https://github.com/puppeteer/puppeteer/issues/4964
          '--disable-features=site-per-process',
        ],
        devtools: false,
      },
      manualStart: false,
      restart: false,
      keepCookies: true,
      keepBrowserState: false,
    },
    FileSystem: {},
  },
  plugins: {
    screenshotOnFail: {
      enabled: false,
    },
    retryTo: {
      enabled: true
    },
    tryTo: {
      enabled: true,
      require: ''
    }
  },
  require: ['ts-node/register'],

};

主要言語
JavaScript
スター
4.2k
フォーク
756
平均マージ
2日 9時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。