From 593a5a7a2a5b92b6683210ee0bd5a75b9c356fe4 Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:48:49 +0900 Subject: [PATCH 01/13] =?UTF-8?q?Test:=20=EB=91=90=EB=B2=88=EC=A7=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A0=81=EC=82=AC=ED=95=AD=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/cypress/support/commands.ts | 61 +++++++++++----------------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 698b01a4..ea399b9c 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -1,37 +1,24 @@ -/// -// *********************************************** -// This example commands.ts shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** -// -// -// -- This is a parent command -- -// Cypress.Commands.add('login', (email, password) => { ... }) -// -// -// -- This is a child command -- -// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) -// -// declare global { -// namespace Cypress { -// interface Chainable { -// login(email: string, password: string): Chainable -// drag(subject: string, options?: Partial): Chainable -// dismiss(subject: string, options?: Partial): Chainable -// visit(originalFn: CommandOriginalFn, url: string, options: Partial): Chainable -// } -// } -// } \ No newline at end of file +declare namespace Cypress { + interface Chainable { + goSecondPersonalInformation(): Chainable; + } +} + +Cypress.Commands.add("goSecondPersonalInformation", () => { + 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(); // 두번째 인적사항 페이지로 이동 +}); From e0ce4792b8f3163da5b2aca65ffb1077025cb6c9 Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:52:30 +0900 Subject: [PATCH 02/13] =?UTF-8?q?Test:=20viewport=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cypress/e2e/application.second-personal-information.cy.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 frontend/cypress/e2e/application.second-personal-information.cy.ts diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts new file mode 100644 index 00000000..bb2d5962 --- /dev/null +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -0,0 +1,3 @@ +describe("2번째 인적사항 e2e 테스트", () => { + beforeEach(() => cy.viewport(1200, 900)); +}); From 49cc01eb6ecc58b13333161d67af27dc71c4cd9c Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:54:04 +0900 Subject: [PATCH 03/13] =?UTF-8?q?Test:=20=EC=A0=84=EA=B3=B5=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=20=ED=9B=84=20=EB=8B=A4=EC=9D=8C=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=20->=20=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../e2e/application.second-personal-information.cy.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index bb2d5962..f1a15809 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -1,3 +1,13 @@ describe("2번째 인적사항 e2e 테스트", () => { beforeEach(() => cy.viewport(1200, 900)); + + it("전공 입력 후 다음 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + cy.get("input.my-2.border.rounded-lg.p-4.w-full") + .eq(0) + .type("컴퓨터정보통신공학과"); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + }); }); From 357a695ba4770bc5e8afa2d3cce1d9c82c70e5b8 Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:56:27 +0900 Subject: [PATCH 04/13] =?UTF-8?q?Test:=20=EC=A0=84=EA=B3=B5,=20=EB=B3=B5?= =?UTF-8?q?=EC=88=98=EC=A0=84=EA=B3=B5=20=EC=9E=85=EB=A0=A5=20=ED=9B=84=20?= =?UTF-8?q?=EB=8B=A4=EC=9D=8C=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?->=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../e2e/application.second-personal-information.cy.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index f1a15809..0d1ff547 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -10,4 +10,15 @@ describe("2번째 인적사항 e2e 테스트", () => { ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" ).click(); }); + + it("전공, 복수전공 입력 후 다음 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + 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("물리학과"); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + }); }); From ba5d6773ac84e30dd8c480b7688c5da8f630449c Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:57:13 +0900 Subject: [PATCH 05/13] =?UTF-8?q?Test:=20=EC=A0=84=EA=B3=B5,=20=EB=B6=80?= =?UTF-8?q?=EC=A0=84=EA=B3=B5=20=EC=9E=85=EB=A0=A5=20=ED=9B=84=20=EB=8B=A4?= =?UTF-8?q?=EC=9D=8C=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20->=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../e2e/application.second-personal-information.cy.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index 0d1ff547..f10d5ea3 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -21,4 +21,15 @@ describe("2번째 인적사항 e2e 테스트", () => { ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" ).click(); }); + + it("전공, 부전공 입력 후 다음 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + 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(2).type("물리학과"); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + }); }); From 0f4763b429d202289077535a36803df5a6116e35 Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:58:57 +0900 Subject: [PATCH 06/13] =?UTF-8?q?Test:=20=EC=A0=84=EA=B3=B5,=20=EB=B3=B5?= =?UTF-8?q?=EC=88=98=EC=A0=84=EA=B3=B5,=20=EB=B6=80=EC=A0=84=EA=B3=B5=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=20=ED=9B=84=20=EB=8B=A4=EC=9D=8C=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20->=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application.second-personal-information.cy.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index f10d5ea3..5eed5683 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -32,4 +32,16 @@ describe("2번째 인적사항 e2e 테스트", () => { ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" ).click(); }); + + it("전공, 복수전공, 부전공 입력 후 다음 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + 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("건축학과"); + cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("물리학과"); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + }); }); From b09108534b3531b976de7268acedb37b0aab5b47 Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 22:59:37 +0900 Subject: [PATCH 07/13] =?UTF-8?q?Test:=20=EC=95=84=EB=AC=B4=EA=B2=83?= =?UTF-8?q?=EB=8F=84=20=EC=9E=85=EB=A0=A5=ED=95=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EA=B3=A0=20=EB=8B=A4=EC=9D=8C=20=EB=B2=84=ED=8A=BC=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20->=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../e2e/application.second-personal-information.cy.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index 5eed5683..621e6b2c 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -44,4 +44,14 @@ describe("2번째 인적사항 e2e 테스트", () => { ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" ).click(); }); + + it("아무것도 입력하지 않고 다음 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + cy.on("window:alert", (text) => { + console.log("Alert message:", text); + }); + }); }); From 26f4eba82eb12bbdea9b0c712b50d238c160f1cf Mon Sep 17 00:00:00 2001 From: minbo Date: Fri, 23 Aug 2024 23:00:12 +0900 Subject: [PATCH 08/13] =?UTF-8?q?Test:=20=EC=A0=84=EA=B3=B5=EC=9D=84=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=ED=95=98=EC=A7=80=20=EC=95=8A=EA=B3=A0=20?= =?UTF-8?q?=EB=B3=B5=EC=88=98=EC=A0=84=EA=B3=B5,=20=EB=B6=80=EC=A0=84?= =?UTF-8?q?=EA=B3=B5=EC=9D=84=20=EC=9E=85=EB=A0=A5=20=ED=9B=84=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20->=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application.second-personal-information.cy.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index 621e6b2c..54ba8674 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -54,4 +54,16 @@ describe("2번째 인적사항 e2e 테스트", () => { console.log("Alert message:", text); }); }); + + it("전공을 입력하지 않고 복수전공, 부전공을 입력 후 버튼 클릭", () => { + cy.goSecondPersonalInformation(); + cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(1).type("건축학과"); + cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("물리학과"); + cy.get( + ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" + ).click(); + cy.on("window:alert", (text) => { + console.log("Alert message:", text); + }); + }); }); From 903c3d0fea13fa367c78b887d5eec32ce7c1aad2 Mon Sep 17 00:00:00 2001 From: minbo Date: Sat, 24 Aug 2024 13:04:17 +0900 Subject: [PATCH 09/13] =?UTF-8?q?test:=20goSecondPersonalInformation=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95=20=EC=83=88=EB=A1=9C?= =?UTF-8?q?=EC=9A=B4=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=A7=84=ED=96=89=20?= =?UTF-8?q?=EC=A0=84=20=EB=A1=9C=EC=BB=AC=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EC=A7=80=20=EC=82=AD=EC=A0=9C=20=EA=B0=9C=EB=B0=9C=EC=9E=90?= =?UTF-8?q?=EA=B0=80=20=EC=95=8C=EC=95=84=EB=B3=B4=EA=B8=B0=20=ED=8E=B8?= =?UTF-8?q?=ED=95=98=EA=B2=8C=20=EC=84=A0=ED=83=9D=EC=9E=90=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/cypress/support/commands.ts | 51 ++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index ea399b9c..7e1cd65e 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -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(); }); From dfd018c51a9efeba0de13dbe4a69b6f760e22406 Mon Sep 17 00:00:00 2001 From: minbo Date: Sat, 24 Aug 2024 13:37:22 +0900 Subject: [PATCH 10/13] =?UTF-8?q?test:=20=EB=91=90=EB=B2=88=EC=A7=B8=20?= =?UTF-8?q?=EC=9D=B8=EC=A0=81=EC=82=AC=ED=95=AD=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD=20=EA=B0=9C?= =?UTF-8?q?=EB=B0=9C=EC=9E=90=EA=B0=80=20=EC=95=8C=EC=95=84=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=20=ED=8E=B8=ED=95=98=EA=B2=8C=20=ED=83=9C=EA=B7=B8=20?= =?UTF-8?q?=EC=8B=9D=EB=B3=84=EC=9E=90=20=EB=B3=80=EA=B2=BD=20assertion=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lication.second-personal-information.cy.ts | 112 ++++++++++++------ 1 file changed, 74 insertions(+), 38 deletions(-) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index 54ba8674..7893e4bf 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -1,67 +1,103 @@ describe("2번째 인적사항 e2e 테스트", () => { beforeEach(() => cy.viewport(1200, 900)); - it("전공 입력 후 다음 버튼 클릭", () => { + it("전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { cy.goSecondPersonalInformation(); - cy.get("input.my-2.border.rounded-lg.p-4.w-full") - .eq(0) + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "전공*") + .parent() + .next("input") + .should("exist") .type("컴퓨터정보통신공학과"); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("button").contains("다음").should("exist").click(); }); - it("전공, 복수전공 입력 후 다음 버튼 클릭", () => { + it("전공, 복수전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { cy.goSecondPersonalInformation(); - cy.get("input.my-2.border.rounded-lg.p-4.w-full") - .eq(0) + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "전공*") + .parent() + .next("input") + .should("exist") .type("컴퓨터정보통신공학과"); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(1).type("물리학과"); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("span") + .filter( + (index, element) => Cypress.$(element).text().trim() === "복수전공" + ) + .parent() + .next("input") + .should("exist") + .type("건축학과"); + cy.get("button").contains("다음").should("exist").click(); }); - it("전공, 부전공 입력 후 다음 버튼 클릭", () => { + it("전공, 부전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { cy.goSecondPersonalInformation(); - cy.get("input.my-2.border.rounded-lg.p-4.w-full") - .eq(0) + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "전공*") + .parent() + .next("input") + .should("exist") .type("컴퓨터정보통신공학과"); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("물리학과"); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "부전공") + .parent() + .next("input") + .should("exist") + .type("물리학과"); + cy.get("button").contains("다음").should("exist").click(); }); - it("전공, 복수전공, 부전공 입력 후 다음 버튼 클릭", () => { + it("전공, 복수전공, 부전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { cy.goSecondPersonalInformation(); - cy.get("input.my-2.border.rounded-lg.p-4.w-full") - .eq(0) + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "전공*") + .parent() + .next("input") + .should("exist") .type("컴퓨터정보통신공학과"); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(1).type("건축학과"); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("물리학과"); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("span") + .filter( + (index, element) => Cypress.$(element).text().trim() === "복수전공" + ) + .parent() + .next("input") + .should("exist") + .type("건축학과"); + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "부전공") + .parent() + .next("input") + .should("exist") + .type("물리학과"); + cy.get("button").contains("다음").should("exist").click(); }); - it("아무것도 입력하지 않고 다음 버튼 클릭", () => { + it("아무것도 입력하지 않고 다음 버튼 클릭하면 '필수 질문을 작성해주세요.'라는 alert창이 보인다.", () => { cy.goSecondPersonalInformation(); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("button").contains("다음").should("exist").click(); cy.on("window:alert", (text) => { console.log("Alert message:", text); }); }); - it("전공을 입력하지 않고 복수전공, 부전공을 입력 후 버튼 클릭", () => { + it("전공을 입력하지 않고 복수전공, 부전공을 입력 후 다음 버튼 클릭하면 '필수 질문을 작성해주세요.'라는 alert창이 보인다.", () => { cy.goSecondPersonalInformation(); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(1).type("건축학과"); - cy.get("input.my-2.border.rounded-lg.p-4.w-full").eq(2).type("물리학과"); - cy.get( - ".flex-1.rounded-md.flex.justify-center.items-center.p-4.bg-dark.text-white" - ).click(); + cy.get("span") + .filter( + (index, element) => Cypress.$(element).text().trim() === "복수전공" + ) + .parent() + .next("input") + .should("exist") + .type("건축학과"); + cy.get("span") + .filter((index, element) => Cypress.$(element).text().trim() === "부전공") + .parent() + .next("input") + .should("exist") + .type("물리학과"); + cy.get("button").contains("다음").should("exist").click(); cy.on("window:alert", (text) => { console.log("Alert message:", text); }); From ed054927094dd6ab8df13218bd9a27f387528315 Mon Sep 17 00:00:00 2001 From: minbo Date: Sat, 24 Aug 2024 13:55:26 +0900 Subject: [PATCH 11/13] =?UTF-8?q?test:=20goSecondPersonalInformation=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=88=98=EC=A0=95=20=ED=94=84=EB=A1=9C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=ED=9D=AC=EB=A7=9D=20=EB=B6=84=EC=95=BC=20?= =?UTF-8?q?2=EC=88=9C=EC=9C=84=EB=A5=BC=20=EC=84=A0=ED=83=9D=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EC=84=A0=ED=83=9D=EC=9E=90=20=EB=B2=88=EA=B2=BD=20?= =?UTF-8?q?assertion=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/cypress/support/commands.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index 7e1cd65e..a385fea8 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -15,15 +15,19 @@ Cypress.Commands.add("goSecondPersonalInformation", () => { .should("exist") .click(); cy.get("span") - .contains("1순위") - .next() - .next() + .filter((index, element) => Cypress.$(element).text().trim() === "2순위") .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("심민보") + .invoke("val") + .should("satisfy", (value) => value.length <= 5); cy.get("span") .contains("연락처") .parent() @@ -38,7 +42,13 @@ Cypress.Commands.add("goSecondPersonalInformation", () => { .type("123456") .invoke("val") .should("match", /^\d{6}$/); - cy.get("span").contains("학적상태").parent().next().type("재학"); + cy.get("span") + .contains("학적상태") + .parent() + .next() + .type("재학") + .invoke("val") + .should("satisfy", (value) => value.length >= 1); cy.get("label").contains("4학년").should("exist").click(); cy.get("label").contains("2학기").should("exist").click(); cy.get("button").contains("다음").should("exist").click(); From 3b34b0a3bbb68aea1da5e8dddc53335261809c0c Mon Sep 17 00:00:00 2001 From: minbo Date: Sun, 25 Aug 2024 12:25:21 +0900 Subject: [PATCH 12/13] =?UTF-8?q?test:=20triple-slash=20directives=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/cypress/support/commands.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/cypress/support/commands.ts b/frontend/cypress/support/commands.ts index a385fea8..6fae91b5 100644 --- a/frontend/cypress/support/commands.ts +++ b/frontend/cypress/support/commands.ts @@ -1,3 +1,5 @@ +/// + declare namespace Cypress { interface Chainable { goSecondPersonalInformation(): Chainable; From 548f121f5cfa81017cd53e427c39ff5af9496ed8 Mon Sep 17 00:00:00 2001 From: minbo Date: Sun, 25 Aug 2024 12:41:41 +0900 Subject: [PATCH 13/13] =?UTF-8?q?test:=20alias=20=EB=AC=B8=EB=B2=95=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...lication.second-personal-information.cy.ts | 102 ++++++------------ 1 file changed, 33 insertions(+), 69 deletions(-) diff --git a/frontend/cypress/e2e/application.second-personal-information.cy.ts b/frontend/cypress/e2e/application.second-personal-information.cy.ts index 7893e4bf..61060a18 100644 --- a/frontend/cypress/e2e/application.second-personal-information.cy.ts +++ b/frontend/cypress/e2e/application.second-personal-information.cy.ts @@ -1,103 +1,67 @@ describe("2번째 인적사항 e2e 테스트", () => { - beforeEach(() => cy.viewport(1200, 900)); + beforeEach(() => { + cy.viewport(1200, 900); - it("전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { cy.goSecondPersonalInformation(); - cy.get("span") - .filter((index, element) => Cypress.$(element).text().trim() === "전공*") - .parent() - .next("input") - .should("exist") - .type("컴퓨터정보통신공학과"); - cy.get("button").contains("다음").should("exist").click(); - }); - it("전공, 복수전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { - cy.goSecondPersonalInformation(); cy.get("span") .filter((index, element) => Cypress.$(element).text().trim() === "전공*") .parent() .next("input") - .should("exist") - .type("컴퓨터정보통신공학과"); + .as("major"); + cy.get("span") .filter( (index, element) => Cypress.$(element).text().trim() === "복수전공" ) .parent() .next("input") - .should("exist") - .type("건축학과"); - cy.get("button").contains("다음").should("exist").click(); - }); + .as("revengeMajor"); - it("전공, 부전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { - cy.goSecondPersonalInformation(); - cy.get("span") - .filter((index, element) => Cypress.$(element).text().trim() === "전공*") - .parent() - .next("input") - .should("exist") - .type("컴퓨터정보통신공학과"); cy.get("span") .filter((index, element) => Cypress.$(element).text().trim() === "부전공") .parent() .next("input") - .should("exist") - .type("물리학과"); - cy.get("button").contains("다음").should("exist").click(); + .as("minor"); + + cy.get("button").contains("다음").as("nextButton"); + }); + + it("전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { + cy.get("@major").type("컴퓨터정보통신공학과"); + cy.get("@nextButton").click(); + }); + + it("전공, 복수전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { + cy.get("@major").type("컴퓨터정보통신공학과"); + cy.get("@revengeMajor").type("건축학과"); + cy.get("@nextButton").click(); + }); + + it("전공, 부전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { + cy.get("@major").type("컴퓨터정보통신공학과"); + cy.get("@minor").type("물리학과"); + cy.get("@nextButton").click(); }); it("전공, 복수전공, 부전공 입력 후 다음 버튼 클릭하면 기타 질문 사항으로 이동", () => { - cy.goSecondPersonalInformation(); - cy.get("span") - .filter((index, element) => Cypress.$(element).text().trim() === "전공*") - .parent() - .next("input") - .should("exist") - .type("컴퓨터정보통신공학과"); - cy.get("span") - .filter( - (index, element) => Cypress.$(element).text().trim() === "복수전공" - ) - .parent() - .next("input") - .should("exist") - .type("건축학과"); - cy.get("span") - .filter((index, element) => Cypress.$(element).text().trim() === "부전공") - .parent() - .next("input") - .should("exist") - .type("물리학과"); - cy.get("button").contains("다음").should("exist").click(); + cy.get("@major").type("컴퓨터정보통신공학과"); + cy.get("@revengeMajor").type("건축학과"); + cy.get("@minor").type("물리학과"); + cy.get("@nextButton").click(); }); it("아무것도 입력하지 않고 다음 버튼 클릭하면 '필수 질문을 작성해주세요.'라는 alert창이 보인다.", () => { - cy.goSecondPersonalInformation(); - cy.get("button").contains("다음").should("exist").click(); + cy.get("@nextButton").click(); cy.on("window:alert", (text) => { console.log("Alert message:", text); }); }); it("전공을 입력하지 않고 복수전공, 부전공을 입력 후 다음 버튼 클릭하면 '필수 질문을 작성해주세요.'라는 alert창이 보인다.", () => { - cy.goSecondPersonalInformation(); - cy.get("span") - .filter( - (index, element) => Cypress.$(element).text().trim() === "복수전공" - ) - .parent() - .next("input") - .should("exist") - .type("건축학과"); - cy.get("span") - .filter((index, element) => Cypress.$(element).text().trim() === "부전공") - .parent() - .next("input") - .should("exist") - .type("물리학과"); - cy.get("button").contains("다음").should("exist").click(); + cy.get("@revengeMajor").type("건축학과"); + cy.get("@minor").type("물리학과"); + cy.get("@nextButton").click(); cy.on("window:alert", (text) => { console.log("Alert message:", text); });