tryTo() triggering false positive to pauseOnFail - stopping at first scenario

Aperta
#4,516 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Riproduci gli scenari forniti di test.js con npx codeceptjs run ./tests/test.js --verbose -p pauseOnFail e confronta il comportamento dei plugin pauseOnFail e tryTo. Non viene indicato alcun file di implementazione o file di test oltre a test.js; il lavoro è considerato completato quando il primo scenario termina senza una pausa erronea e il secondo scenario viene eseguito.

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

Descrizione

What are you trying to achieve?

Trying to run 2 scenarios with one containing tryTo().

What do you get instead?

With the flag -p pauseOnFail, codeceptjs is stopping after scenario 1, even when no error or failure happens.

I believe this is a false positive triggered by tryTo() as seeing in the verbose:

[1] Error (Non-Terminated) | Error: Element "NOPE" is not visible on page. | (err) => { step.status = 'failed'; step.endTime =

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

> npx codeceptjs run ./tests/test.js --verbose -p pauseOnFail

***************************************
nodeInfo:  18.20.4
osInfo:  Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
cpuInfo:  (32) x64 Intel(R) Core(TM) i9-14900HX
chromeInfo:  Not Found
edgeInfo:  "N/A"
firefoxInfo:  undefined
safariInfo:  N/A
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.6.6 #StandWithUkraine
Using test root "xxx"
Helpers: Playwright, Hooks
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement, pauseOnFail

Fixed Assets --
    [1]  Starting recording promises
    Timeouts: 
 › [Session] Starting singleton browser session
  01 - Test
    I am on page "https://github.com/login"
      I am on page "https://github.com/login"
    Info: RetryFailedStep plugin is disabled inside tryTo block
    I see element "NOPE"
      I see element "NOPE"
    [1] <tryTo>  Error (Non-Terminated) | Error: Element "NOPE" is not visible on page. | (err) => { step.status = 'failed'; step.endTime = ...
 › Unsuccessful try > Error: Element "NOPE" is not visible on page.
  ✔ OK in 3961ms

 Interactive shell started
 Use JavaScript syntax to try steps in action
 - Press ENTER to run the next step
 - Press TAB twice to see all available commands
 - Type exit + Enter to exit the interactive shell
 - Prefix => to run js commands 
 I.

Provide test source code if related

Feature('Fixed Assets');

Scenario('01 - Test',  async ({ I }) => {
  await I.amOnPage('https://github.com/login');
  await tryTo(() => I.seeElement('NOPE'))
});

Scenario('02 - Test',  async ({ I }) => {
  await I.amOnPage('https://github.com/login');
});
Details
  • CodeceptJS version: 3.6.6
  • NodeJS Version: 18.20.4
  • Operating System: Ubuntu 22.04.4
  • Playwright
  • Configuration file:
require('dotenv').config();
const http = require('http');
require('./heal');
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure');

// Turn on headless mode when running with HEADLESS=true environment variable
// Export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

// Enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();

/** @type {CodeceptJS.MainConfig} */
exports.config = {
  name: 'xxx',
  // For local development we rename the files we want to test
  tests: './tests/*.js',
  output: './output',
  helpers: {
    Playwright: {
      browser: 'chromium',
      url: 'http://localhost',
      // Default time for all wait* actions
      waitForTimeout: 60000,
      // Time to wait after each action
      waitForAction: 1000,
      // Highlight element only work with --verbose
      highlightElement: true,
      show: true,
      video: true,
      keepVideoForPassedTests: true,
      windowSize: '1024x768',
      recordVideo: { // Seems to not work but required to use windowSize -- solved in 3.6.2
        size: {
          width: 1024,
          height: 768
        }
      },
      trace: false
    },
    Hooks: {
      require: './events/hooks.js'
    },
  },
}
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

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.