Skip to content

Commit

Permalink
test: goSecondPersonalInformation 함수 수정
Browse files Browse the repository at this point in the history
새로운 테스트 진행 전 로컬 스토리지 삭제
개발자가 알아보기 편하게 선택자 변경
  • Loading branch information
smb0123 committed Aug 24, 2024
1 parent 26f4eba commit 903c3d0
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions frontend/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,41 @@ declare namespace Cypress {
}

Cypress.Commands.add("goSecondPersonalInformation", () => {
cy.clearAllLocalStorage();
cy.visit("http://localhost:3000/application");
cy.get('[for=":R7dmlllkq:"]').click();
cy.get('[for=":Rblmlllkq:"]').click();
cy.get('[for=":r1:"]').click();
cy.get(
".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white"
).click(); // 첫번째 인적사항 페이지로 이동
cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(0).type("심민보");
cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(1).type("01000000000");
cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("111111");
cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(3).type("재학");
cy.get('[for=":rb:"]').click();
cy.get('[for=":re:"]').click();
cy.get(
".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white"
).click(); // 두번째 인적사항 페이지로 이동
cy.get("label").contains("개발자").should("exist").click();
cy.get("span")
.contains("1순위")
.next()
.contains("label", "APP")
.should("exist")
.click();
cy.get("span")
.contains("1순위")
.next()
.next()
.next()
.contains("label", "WEB")
.should("exist")
.click();
cy.get("button").contains("다음").should("exist").click();
cy.get("span").contains("이름").parent().next().type("심민보");
cy.get("span")
.contains("연락처")
.parent()
.next()
.type("00000000000")
.invoke("val")
.should("match", /^\d{3}-\d{4}-\d{4}$/);
cy.get("span")
.contains("학번")
.parent()
.next()
.type("123456")
.invoke("val")
.should("match", /^\d{6}$/);
cy.get("span").contains("학적상태").parent().next().type("재학");
cy.get("label").contains("4학년").should("exist").click();
cy.get("label").contains("2학기").should("exist").click();
cy.get("button").contains("다음").should("exist").click();
});

0 comments on commit 903c3d0

Please sign in to comment.