You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.featureFeature: Play aroundScenario: PlaygroundGiven I want to test healers
// playground.tsGiven("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.tsconst{ heal, ai }=require("codeceptjs");heal.addRecipe("waitForVisibleThenClick",{priority: 1,steps: ["click"],fn: async({ step })=>{constlocator=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
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 afterI.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
.This is what is displayed on the logs after the test run:
Details
The text was updated successfully, but these errors were encountered: