`I.waitForURL()` does not fail the test when its timeout happens
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- playwright, typescript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Tái hiện kịch bản từ playground.ts với healer trong heal.ts, sau đó lần theo điểm vào I.waitForURL trong Playwright Helper và cách timeout của nó được báo cáo. Được xem là hoàn tất khi timeout khiến kịch bản thất bại, ngăn không cho thao tác nhấp tiếp theo và healer chạy, đồng thời giữ lại đầu ra lỗi liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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'
}
- Ngôn ngữ chính
- JavaScript
- Star
- 4.2k
- Fork
- 756
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeceptjs/CodeceptJS
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#5420 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeceptjs/CodeceptJS#5358 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeceptjs/CodeceptJS#4958 · 10 bình luận · 2 reaction ·
-
stale
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#4778 · 3 bình luận ·
-
stale
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
codeceptjs/CodeceptJS#5618 · 1 bình luận ·
Tất cả issue của codeceptjs/CodeceptJS
Issue tương tự
-
ai-observability bug team/ai-observability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
AllTheMods/ATM-10-L#19 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SignalK/n2k-signalk#345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
JuliaPluto/PlutoPlotly.jl#72 ·