From 8d0401a63c7f394d0839ab2ba4c4d3992144d7c1 Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Thu, 22 Jun 2023 20:36:24 +0900 Subject: [PATCH 1/7] =?UTF-8?q?[Test]=20[GGFE-99]=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=97=90=EB=9F=AC=20=EC=9E=84=EC=8B=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index f49fe0ef7..257d4cac2 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -1,7 +1,7 @@ export {}; describe('게임 기능 테스트', () => { - before(() => { + beforeEach(() => { cy.login(Cypress.env('NORMAL_USERNAME'), Cypress.env('NORMAL_PASSWORD')); }); beforeEach(() => { From 878d0f753f9ada935089746fc7fdefe3efc28ae1 Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Thu, 22 Jun 2023 20:37:13 +0900 Subject: [PATCH 2/7] =?UTF-8?q?[Test]=20[GGFE-99]=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=9E=9C=EB=8D=94?= =?UTF-8?q?=EB=A7=81=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index 257d4cac2..aa36fc9ef 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -13,29 +13,31 @@ describe('게임 기능 테스트', () => { cy.origin(Cypress.env('HOME'), () => { cy.wait(1000); // 1. 게임 컴포넌트 랜더링 확인 - cy.get('[class^=GameResultItem]').then((gameResultItem) => { + const gameComponentRegex = + '[class^="GameResultItem"][class*="ItemContainer"]'; + cy.get(gameComponentRegex).then(() => { // 2. big 컴포넌트와 small 컴포넌트 갯수 확인 - cy.get('[class^=GameResultItem]') - .filter('[class^=GameResultItem_bigContainer]') + cy.get(gameComponentRegex) + .filter('[class^=GameResultItem_bigItemContainer]') .should('have.length', 1); - cy.get('[class^=GameResultItem]') - .filter('[class^=GameResultItem_smallContainer]') + cy.get(gameComponentRegex) + .filter('[class^=GameResultItem_smallItemContainer]') .should('have.length', 2); // 3. 첫번째 컴포넌트가 big인지 확인 - cy.get('[class^=GameResultItem') + cy.get(gameComponentRegex) .first() .invoke('attr', 'class') .then((className) => { expect(className).to.include('big'); }); // 4. 첫번째 small 컴포넌트 클릭 - cy.get('[class^=GameResultItem_smallContainer]').first().click(); + cy.get('[class^=GameResultItem_smallItemContainer]').first().click(); // wait for rendering cy.wait(1000); // 5. 첫번째 Container 컴포넌트가 small인지 확인 - cy.get('[class^=GameResultItem') + cy.get(gameComponentRegex) .first() .invoke('attr', 'class') .then((className) => { From 15c809329a7f1d98a910d8632bf46d5fbb08531e Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Thu, 22 Jun 2023 22:21:20 +0900 Subject: [PATCH 3/7] =?UTF-8?q?[Test]=20[GGFE-99]=20=EA=B2=8C=EC=9E=84=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4=EB=8F=99=20=EB=B0=8F=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=A0=8C=EB=8D=94?= =?UTF-8?q?=EB=A7=81=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index aa36fc9ef..7478c002a 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -49,35 +49,35 @@ describe('게임 기능 테스트', () => { it('게임 페이지 이동 및 컴포넌트 렌더링 확인 🤔', () => { cy.origin(Cypress.env('HOME'), () => { //1. 게임 페이지 이동 - cy.get('a').filter("[href='/game']").click(); + cy.contains('Current Play').parent().find('button').click(); // wait for rendering cy.wait(1000); // 2. 게임 컴포넌트 랜더링 확인 - cy.get('input[value="더 보기"]').click(); + cy.get('button[class*="getButton"]').click(); // wait for rendering cy.wait(1000); - cy.get('div[class*="smallContainer"]').each(($el1) => { + cy.get('div[class*="smallItemContainer"]').each(($el1) => { cy.wrap($el1).click(); }); // 3. 노말 게임으로 변경 및 컴포넌트 렌더링 확인 - cy.get('input[type="radio"][value="normal"]') + cy.get('input[type="radio"][value="NORMAL"]') .as('normalRadioBtn') .click() .then(() => { cy.wait(1000); - cy.get('div[class*="smallContainer"]').each(($el2) => { + cy.get('div[class*="smallItemContainer"]').each(($el2) => { cy.wrap($el2).click(); }); }); // wait for rendering cy.wait(1000); // 4. 랭크 게임으로 변경 및 컴포넌트 렌더링 확인 - cy.get('input[type="radio"][value="rank"]') + cy.get('input[type="radio"][value="RANK"]') .as('rankRadioBtn') .click() .then(() => { cy.wait(1000); - cy.get('div[class*="smallContainer"]').each(($el3) => { + cy.get('div[class*="smallItemContainer"]').each(($el3) => { cy.wrap($el3).click(); }); }); From e6b9f3502f9c4d489753e5f7648670d9752b1ea7 Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Thu, 22 Jun 2023 22:40:43 +0900 Subject: [PATCH 4/7] =?UTF-8?q?[Test]=20[GGFE-99]=20=EC=9C=A0=EC=A0=80=20?= =?UTF-8?q?=EA=B2=80=EC=83=89=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index 7478c002a..ec9dfdf0d 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -86,7 +86,7 @@ describe('게임 기능 테스트', () => { it('유저 검색 확인 🤔', () => { cy.origin(Cypress.env('HOME'), () => { // 1. 게임 페이지 이동 - cy.get('a').filter("[href='/game']").click(); + cy.contains('Current Play').parent().find('button').click(); // wait for rendering cy.wait(1000); // 2. 가장 최근 경기한 유저 아이디 검색 @@ -103,13 +103,13 @@ describe('게임 기능 테스트', () => { // wait for rendering cy.wait(1000); // 3. 모든 작은 게임 컴포넌트에 유저 아이디가 일치하는지 확인 - cy.get('[class^=GameResultItem_smallContainer]').each( + cy.get('[class^=GameResultItem_smallItemContainer]').each( ($smallContainer) => { const $smallTeams = $smallContainer.find( '[class^=GameResultItem_smallTeam]' ); - const intraId1 = $smallTeams.eq(0).find('span div').text(); - const intraId2 = $smallTeams.eq(1).find('span div').text(); + const intraId1 = $smallTeams.eq(0).find('span').text(); + const intraId2 = $smallTeams.eq(1).find('span').text(); if (intraId1 === userId || intraId2 === userId) { return; From 257ffb77cc5ee320e8052d71576f9e4c4f9a0dc8 Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Thu, 22 Jun 2023 22:49:12 +0900 Subject: [PATCH 5/7] =?UTF-8?q?[Test]=20[GGFE-99]=20Live=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=9E=9C?= =?UTF-8?q?=EB=8D=94=EB=A7=81=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index ec9dfdf0d..7f841593b 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -125,38 +125,40 @@ describe('게임 기능 테스트', () => { // 1. live 상태 컴포넌트 랜더링 확인 cy.origin(Cypress.env('HOME'), () => { let gameId = ''; - cy.get('[class^=GameResultItem_bigContainer]').each(($bigContainer) => { - const $bigScore = $bigContainer.find( - '[class^=GameResultItem_bigScore]' - ); - const $status = $bigScore.find('[class^=GameResultItem_gameStatus]'); + cy.get('[class^=GameResultItem_bigItemContainer]').each( + ($bigContainer) => { + const $bigScore = $bigContainer.find( + '[class^=GameResultItem_bigScore]' + ); + const $status = $bigScore.find('[class^=GameResultItem_gameStatus]'); - // 첫번째 컴포넌트 live 상태인지 확인 및 맞으면 저장 - if ( - $status.hasClass('GameResultItem_gameStatusWait') || - ($status.text() && $status.text() === 'LIVE') - ) { - cy.wrap($bigContainer) - .invoke('attr', 'id') - .then((id) => { - gameId = String(id); - }); + // 첫번째 컴포넌트 live 상태인지 확인 및 맞으면 저장 + if ( + $status.hasClass('GameResultItem_gameStatusWait') || + ($status.text() && $status.text() === 'LIVE') + ) { + cy.wrap($bigContainer) + .invoke('attr', 'id') + .then((id) => { + gameId = String(id); + }); + } } - }); - cy.get('a').filter("[href='/game']").click(); + ); + cy.contains('Current Play').parent().find('button').click(); // Wait for rendering cy.wait(2000); - cy.get('[class^=GameResultItem_bigContainer]') + cy.get('[class^=GameResultItem_bigItemContainer]') .invoke('attr', 'id') .then((id) => { if (gameId === id) { throw new Error('live 상태가 있습니다'); } }); - cy.get('div[class*="smallContainer"]').each(($el1) => { + cy.get('div[class*="smallItemContainer"]').each(($el1) => { cy.wrap($el1).click(); cy.wait(1000); - cy.get('[class^=GameResultItem_bigContainer]') + cy.get('[class^=GameResultItem_bigItemContainer]') .invoke('attr', 'id') .then((id) => { if (gameId === id) { From 85a2dc1cb99759da6cf48bc082fb827a755b598d Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Fri, 23 Jun 2023 14:17:15 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[Test]=20[GGFE-99]=20Match=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=A7=84=EC=9E=85=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/match.cy.ts | 15 ++++++++------- cypress/support/commands.ts | 24 +++++++++++++----------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/cypress/e2e/match.cy.ts b/cypress/e2e/match.cy.ts index de400b976..014fbd6bf 100644 --- a/cypress/e2e/match.cy.ts +++ b/cypress/e2e/match.cy.ts @@ -5,18 +5,19 @@ describe('매치 기능 테스트', () => { cy.login(Cypress.env('NORMAL_USERNAME'), Cypress.env('NORMAL_PASSWORD')); cy.origin(Cypress.env('HOME'), () => { // 매치 버튼 눌러 매치 페이지로 - cy.get('a').filter('[class^=Layout_matchingButton]').click(); - // 토글 눌러서 일반전으로 변경 + cy.get('[class^=StyledButton_button]').click(); + // 일반전으로 이동 cy.wait(1000); - cy.get('[class^=ModeToggle_toggleButton]').click(); - cy.get('span[class^=ModeToggle_toggleText]').should('have.text', '일반'); + cy.get('[class^=ModeRadiobox_normal]').click(); cy.wait(1000); - // 두번째로 가능한 슬롯 잡기 - cy.register(1, '1/2'); + }); + // 첫번째로 가능한 슬롯 잡기 + cy.register(0, '1/2'); + cy.origin(Cypress.env('HOME'), () => { // TODO : alert 확인 // 위 현재 매치 정보 확인, 취소 버튼 뜨는지 확인 cy.wait(3000); - cy.get('[class^=CurrentMatchInfo_container]').should('exist'); + cy.get('[class^=CurrentMatchInfo_currentMatchContent]').should('exist'); cy.get('[class^=CurrentMatchInfo_cancelButton]').should('exist'); }); cy.logout(Cypress.env('NORMAL_USERNAME')); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index fe6a0c815..c6fa9663f 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -61,19 +61,21 @@ Cypress.Commands.add('logout', (username: string) => { // target 표시의 슬롯 중 flag 번째의 슬롯을 등록하는 command Cypress.Commands.add('register', (flag: number, target: '+' | '1/2') => { - let count = 0; - cy.get('[class*=MatchSlot_plus]').each(($el4) => { - if ($el4.text() === target) { - if (flag != count) { - count++; - return; + cy.origin(Cypress.env('HOME'), () => { + let count = 0; + cy.get('[class*=MatchSlot_plus]').each(($el4) => { + if ($el4.text() === target) { + if (flag != count) { + count++; + return; + } + cy.wrap($el4).click(); + return false; } - cy.wrap($el4).click(); - return false; - } + }); + cy.wait(1000); + cy.get('input[value=확인]').click(); }); - cy.wait(1000); - cy.get('input[value=확인]').click(); }); // 경기 결과 입력 테스트 command (success: true => 의도한 성공, false => 의도한 실패) From ab8d228e274343482193fc059780383ea6463156 Mon Sep 17 00:00:00 2001 From: yoouyeon Date: Fri, 23 Jun 2023 14:27:31 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[Chore]=20[GGFE-99]=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=97=90=EB=9F=AC=EC=BC=80=EC=9D=B4=EC=8A=A4?= =?UTF-8?q?=EC=97=90=20=EB=8C=80=ED=95=9C=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cypress/e2e/game.cy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/e2e/game.cy.ts b/cypress/e2e/game.cy.ts index 7f841593b..3708a31dd 100644 --- a/cypress/e2e/game.cy.ts +++ b/cypress/e2e/game.cy.ts @@ -71,6 +71,7 @@ describe('게임 기능 테스트', () => { }); // wait for rendering cy.wait(1000); + // NOTE : 새로운 시즌이 시작된 경우에는 컴포넌트가 없는게 정상입니다. // 4. 랭크 게임으로 변경 및 컴포넌트 렌더링 확인 cy.get('input[type="radio"][value="RANK"]') .as('rankRadioBtn')