Skip to content

Commit

Permalink
fix cypress login issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aorin committed Nov 22, 2024
1 parent 91c9f00 commit 339f206
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions frontend/cypress/e2e/methods.js
Original file line number Diff line number Diff line change
@@ -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: "[email protected]"
};


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();
Expand Down

0 comments on commit 339f206

Please sign in to comment.