Since Codecept 3.6.9, our test that looks for a date time doesn't find it (but it's there)

Aperta
#4,632 17 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
javascript, node.js, playwright
Ambito
testing-qa

Direzione di ricerca

Inizia da lib/helper/Playwright.js:2854, dove viene segnalato il fallimento, e dal test chiamante in codecept/user-logs.spec.js:39. Riproduci la regressione con Playwright 1.49.1 su CodeceptJS 3.6.7 e 3.6.9, quindi esamina il comportamento di waitForText e aggiungi un test di regressione se la causa può essere isolata. Il lavoro è completato quando viene trovato il timestamp visibile senza indebolire i controlli di testo non correlati.

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

Descrizione

stale

Hi, we're seeing this issue and we've tried pinning to older versions - 3.6.7 is OK.

What are you trying to achieve?

We have a test that's been passing up until now and does so with 3.6.7.

I can't use 3.6.8 because of Error: Cannot find module 'invisi-data' (I noticed a hotfix around this in the commits).

It started failing today (it could have failed sooner, we only noticed it today).

What do you get instead?

The following (I've noticed the UI here says 3.6.2, but when I do an npm list I am on 3.6.7, 3.6.8, or 3.6.9 depending on the test I am doing - we want to be on the latest and tried downgrading twice and as part of that verified 3.6.7 is ok).

image

This looks to me like it finds our text and then says it hasn't...

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

1) User Logs
       It renders a User Log table:
     Text "2024-09-05 04:14:32.000" was not found on page after 1 sec.
      at Playwright.waitForText (node_modules/codeceptjs/lib/helper/Playwright.js:2854:26)
      at async Test.<anonymous> (codecept/user-logs.spec.js:39:3)
  
  

  2) User Logs
       It renders a new User Log table:
     Text "2024-09-06 10:14:50.000" was not found on page after 1 sec.
      at Playwright.waitForText (node_modules/codeceptjs/lib/helper/Playwright.js:2854:26)
      at runNextTicks (node:internal/process/task_queues:60:5)
      at process.processTimers (node:internal/timers:509:9)

Provide test source code if related
Sorry - I don't have a minimal reproduce yet - we basically have a simple logging page and we're looking for an event time on it in a row

Scenario('It renders a User Log table', async ({ I }) => {
  I.amOnPage('http://localhost:5057/iframe.html?args=&id=demo-logs-page--renders-correctly&viewMode=story')

  I.waitForText('Logs', 10)

  await sleep(10000)

  // Check there is a table
  I.seeElement('.IntegrationDataTable')
  I.seeNumberOfVisibleElements('.UserLogsPage__Table tbody tr[data-parent-row="true"]', 14)
  I.see('14 of 10000')

  // Check column headings
  I.see('Event time (UTC)')
  I.see('Message')
  I.see('Transaction ID')
  I.see('Flow ID')
  I.see('Log level')

  // Check first row
  let firstRow = locate('.UserLogsPage__Table tbody tr[data-parent-row="true"]').first()
  console.log('first', firstRow)

  await within(firstRow, () => {
    I.waitForText('2024-09-05 04:14:32.000') <---------- see here
  })
Details
  • CodeceptJS version: 3.6.9
  • NodeJS Version: we've tried with Node.js 22.9.0 and 18.20.4
  • Operating System: I'm on Mac OSX
  • puppeteer || webdriverio || testcafe version (if related)

We are using Playwright 1.49.1

  • Configuration file:

exports.config = {
  tests: './codecept/*.spec.js',
  output: './codecept/screenshots',
  retry: 2,
  helpers: {
    Playwright: {
      url: 'http://localhost:9010',
      show: false,
      browser: 'chromium',
      pressKeyDelay: 2,
      waitForAction: 5000
    }
  },
  bootstrap: null,
  mocha: {},
  name: 'ui-logging',
  plugins: {
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    },
    screenshotOnFail: {
      enabled: true
    },
    customLocator: {
      enabled: true,
      attribute: 'data-testid'
    }
  }
}
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.