echoing-hamburger-46900
03/06/2023, 11:20 AMcy.get(".classOfElement", {timeout:10000}).should("be.visible").and("contain", "some text ")
From my understanding, the chained should() should abide by the timeout defined in get(). So even if the element is found by get() it won't return the element until the should() and the and() are satisfied. Am I wrong? Is that not how it works?
Currently the behaviour I see is that the initial get() runs, the element is found, but it doesn't seem to wait any longer after that for the chained commands. Which in turn instantly fail because the contents hasn't loaded yet.gray-kilobyte-89541
03/06/2023, 2:21 PMechoing-hamburger-46900
03/06/2023, 2:48 PMget('body') which passes and then in afterEach i run a simple get(".element", {10_000}).should("be.visible") (yeah i even added a 10 secs). I run this, and it works like a charm, no issues. But as soon as I update the test to include .should("not.exist") the afterEach block straight up fails, instantly, regardless of the timeout added; and it fails with $el.css is not a function if i just have the visibility check, but if i add a .click() instead i get No elements in the current DOM matched your query which is complete rubbish 😅 - if all i change is the result of the test that has nothing to do with the page behaviour and the afterEach behaviour changes, how, why?
In my search for answers I found this GH issue that was raised back in 2018: https://github.com/cypress-io/cypress/issues/2831 the suggested workaround is to use {force: true} but that also hasn't worked.gray-kilobyte-89541
03/06/2023, 7:44 PMechoing-hamburger-46900
03/07/2023, 8:51 AMechoing-hamburger-46900
03/07/2023, 10:47 AMechoing-hamburger-46900
03/07/2023, 10:47 AMgray-kilobyte-89541
03/07/2023, 12:56 PMafterEach should execute, even if the test fails, you probably have something else going on thereechoing-hamburger-46900
03/07/2023, 1:35 PM