mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-25 04:43:03 +03:00
Prevent use of wait in cypress test to make it more resilient.
This commit is contained in:
parent
d16c1699f1
commit
0685561fd1
@ -12,7 +12,6 @@ context("fetchers", () => {
|
|||||||
addItem("5");
|
addItem("5");
|
||||||
cy.wait(100);
|
cy.wait(100);
|
||||||
addItem("501");
|
addItem("501");
|
||||||
cy.wait(1000);
|
|
||||||
expectList("5", "500", "501");
|
expectList("5", "500", "501");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -23,8 +22,9 @@ function addItem(itemName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function expectList(...list) {
|
function expectList(...list) {
|
||||||
|
cy.get("ul#items>li.loading").should("have.length", 0);
|
||||||
cy.get("ul#items>li")
|
cy.get("ul#items>li")
|
||||||
.should("have.length", 3)
|
.should("have.length", list.length)
|
||||||
.then(($els) => {
|
.then(($els) => {
|
||||||
// source: https://glebbahmutov.com/cypress-examples/7.1.0/recipes/get-text-list.html#getting-text-from-list-of-elements
|
// source: https://glebbahmutov.com/cypress-examples/7.1.0/recipes/get-text-list.html#getting-text-from-list-of-elements
|
||||||
// we get a list of jQuery elements
|
// we get a list of jQuery elements
|
||||||
|
@ -247,7 +247,7 @@ view maybeUrl sharedModel model app =
|
|||||||
(\item ->
|
(\item ->
|
||||||
case item of
|
case item of
|
||||||
Pending name ->
|
Pending name ->
|
||||||
Html.li [] [ Html.text <| name ++ "..." ]
|
Html.li [ Attr.class "loading" ] [ Html.text <| name ++ "..." ]
|
||||||
|
|
||||||
Created name ->
|
Created name ->
|
||||||
Html.li [] [ Html.text name ]
|
Html.li [] [ Html.text name ]
|
||||||
|
Loading…
Reference in New Issue
Block a user