swithTo/within not swith to iframe

Aperta
#4,414 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, nodejs
Ambito
testing-qa

Direzione di ricerca

Inizia riproducendo il flusso Puppeteer fornito in CodeceptJS 3.6, concentrandoti su switchTo, within e waitForElement con i selettori iframe forniti. Confronta il comportamento con CodeceptJS 3.4.1 e aggiungi una copertura di regressione quando il problema è stato isolato; il lavoro è completato quando i selettori di input iframe vengono risolti e la sequenza fornita viene completata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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'],

};

Lingua principale
JavaScript
Stelle
4.2k
Fork
756
Merge medio
2g 9h
PR unite (30g)
16

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codeceptjs/CodeceptJS

Tutte le issue di codeceptjs/CodeceptJS

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.