`I.waitForURL()` does not fail the test when its timeout happens
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 32/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- playwright, typescript
- Domínio
- testing-qa
Direção de pesquisa
Reproduza o cenário de playground.ts com o healer em heal.ts e, em seguida, rastreie o ponto de entrada I.waitForURL no Playwright Helper e como o timeout é reportado. Está concluído quando o timeout faz o cenário falhar, impede a execução do clique posterior e do healer e preserva a saída de falha relevante.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What are you trying to achieve?
Wait for the page to navigate to a certain URL and fail the test if it doesn't navigate within the defined timeout
What do you get instead?
The test does not fail. As per the source code, we should never get to I.click("#fake-id");, but we do. Also, In the below source code, the log after I.waitForURL() is never printed. Where does it disappear to? The log that's printed is the one that's within the healer, HEALING A FAILED CLICK STEP:#fake-id.
Provide test source code if related
# Playground.feature
Feature: Play around
Scenario: Playground
Given I want to test healers
// playground.ts
Given("I want to test healers", () => {
I.amOnPage("https://github.com/codeceptjs/CodeceptJS/issues");
I.say("before waitForURL");
I.waitForURL("https://fake-url", {
timeout: 10000,
waitUntil: "load"
});
I.say("after waitForURL");
I.click("#fake-id");
});
// heal.ts
const { heal, ai } = require("codeceptjs");
heal.addRecipe("waitForVisibleThenClick", {
priority: 1,
steps: [
"click"
],
fn: async ({ step }) => {
const locator = step.args[0];
return ({ I }) => {
I.say("HEALING A FAILED CLICK STEP:" + locator);
I.waitForVisible(locator, 9);
I.click(locator);
};
},
});
This is what is displayed on the logs after the test run:
Play around --
Playground
Given I want to test healers ""
before waitForURL <--------------------------------------------- see here
I say "HEALING A FAILED CLICK STEP:#fake-id" <----------------- and here
HEALING A FAILED CLICK STEP:#fake-id <------------------------- and here
I wait for visible "#fake-id", 9
× FAILED in 29095ms
-- FAILURES:
1) Play around
Playground:
element (#fake-id) still not visible after 9 sec
locator.waitFor: Timeout 9000ms exceeded.
Call log:
- waiting for locator('#fake-id').first() to be visible
Error: element (#fake-id) still not visible after 9 sec
locator.waitFor: Timeout 9000ms exceeded.
Call log:
Scenario Steps:
- I.waitForURL("https://fake-url", {"timeout":10000,"waitUntil":"load"}) at .\tests\steps\playground.ts:21:5
- I.say("before waitForURL") at .\tests\steps\playground.ts:20:5
- I.amOnPage("https://github.com/codeceptjs/CodeceptJS/issues") at .\tests\steps\playground.ts:19:5
Details
- CodeceptJS version: 3.6.2
- NodeJS Version: 20.12.2
- Operating System: Windows 11
- Helper: Playwright Helper
- Configuration file:
require('./heal')
export const config: CodeceptJS.MainConfig = {
output: './output',
helpers: {
Playwright: {
url: "https://github.com/codeceptjs/CodeceptJS/issues",
show: false,
browser: 'chromium'
}
},
gherkin: {
features: ["./tests/**/features/Playground.feature"],
steps: "./tests/**/steps/*.ts"
// steps: ["./stock_take_service/steps/given.ts", "./stock_take_service/steps/when.ts", "./stock_take_service/steps/then.ts"]
},
include: {
I: './steps_file',
},
plugins: {
heal: {
enabled: true
}
},
name: 'playground'
}
- Linguagem predominante
- JavaScript
- Estrelas
- 4.2k
- Forks
- 756
- Merge médio
- 2d 9h
- PRs com merge (30d)
- 16
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de codeceptjs/CodeceptJS
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentário ·
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
codeceptjs/CodeceptJS#5358 · 1 comentário ·
-
stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentários · 2 reações ·
-
stale
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentários ·
-
stale
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 38/100
codeceptjs/CodeceptJS#5618 · 1 comentário ·
Todas as issues de codeceptjs/CodeceptJS
Issues semelhantes
-
Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Automattic/safe-publish#594 ·
-
内部文件键(绝对路径的 base64)泄漏到界面标签 Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
NousResearch/hermes-agent#121143 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100