Skip to content

Commit

Permalink
test: wait 추가, goOtherQuestions 함수 추가
Browse files Browse the repository at this point in the history
가끔씩 텍스트가 "2순위"인 span 태그를 인식하지 못하여 wait를
추가하였습니다.
  • Loading branch information
smb0123 committed Aug 28, 2024
1 parent db92db8 commit 2f19742
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ declare namespace Cypress {
checkLocalStorage(key: string, expectedValue: string): Chainable<void>;
checkAlert(expectedValue: string): Chainable<void>;
goSecondPersonalInformation(): Chainable<void>;
goOtherQuestions(): Chainable<void>;
}
}

Expand Down Expand Up @@ -34,6 +35,7 @@ Cypress.Commands.add("goSecondPersonalInformation", () => {
.contains("label", "APP")
.should("exist")
.click();
cy.wait(1000);
cy.get("span")
.filter((index, element) => Cypress.$(element).text().trim() === "2순위")
.next()
Expand Down Expand Up @@ -73,3 +75,14 @@ Cypress.Commands.add("goSecondPersonalInformation", () => {
cy.get("label").contains("2학기").should("exist").click();
cy.get("button").contains("다음").should("exist").click();
});

Cypress.Commands.add("goOtherQuestions", () => {
cy.goSecondPersonalInformation();
cy.get("span")
.filter((index, element) => Cypress.$(element).text().trim() === "전공*")
.parent()
.next("input")
.type("컴퓨터정보통신공학과");

cy.get("button").contains("다음").click();
});

0 comments on commit 2f19742

Please sign in to comment.