diff --git a/frontend/cypress/e2e/methods.js b/frontend/cypress/e2e/methods.js index e503e0b7..7d9d9f68 100644 --- a/frontend/cypress/e2e/methods.js +++ b/frontend/cypress/e2e/methods.js @@ -1,40 +1,12 @@ - export function myBeforeEach() { - cy.wait(1000); - cy.visit("http://localhost:3000"); - const personToken = Cypress.env("person_token"); const loginUrl = `http://localhost:3000/api/login?token=${personToken}`; - if (loginPort === 3000) { - cy.visit(loginUrl); - } else { - cy.request(loginUrl); - } - - cy.visit("http://localhost:3000"); - - - - - const user = { - id: "asdf", - fullName: "Lintu Asema", - emailAddress: "lintuasema@lintuasema.com" - }; - - - cy.window() - .its("store") - .invoke("dispatch", { - type: "SET_USER", - data: { - user - }, - }); + cy.visit(loginUrl); - cy.get("body").wait(1000) + cy.get("#select-observatory,#observatorySelector",{ timeout: 5000 }).should("exist"); + cy.get("body") .then(($body) => { if ($body.text().includes("Valitse")) { cy.get("#select-observatory").click();