-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from SWM-FIRE/FIRE-805-테스트코드-수정-2022-10-03
FIRE-805 edit test code
- Loading branch information
Showing
10 changed files
with
93 additions
and
343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,79 +21,73 @@ describe('try login', () => { | |
); | ||
|
||
// mock get my data | ||
cy.intercept({ method: 'GET', url: API.ME }, { fixture: 'me.json' }); | ||
cy.intercept( | ||
{ method: 'GET', url: API.RECORDS }, | ||
{ fixture: 'records.json' }, | ||
); | ||
// cy.intercept({ method: 'GET', url: API.ME }, { fixture: 'me.json' }); | ||
cy.visit('http://localhost:3000'); | ||
cy.viewport(1536, 960); | ||
}); | ||
|
||
// successful login | ||
it('login success', () => { | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.get('input[placeholder="이메일"]').type('[email protected]'); | ||
cy.get('input[placeholder="비밀번호"]').type('cypress0909!!'); | ||
cy.get('[data-cy="login-button"]').click(); | ||
|
||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.get('input[placeholder="이메일"]').type('[email protected]'); | ||
// cy.get('input[placeholder="비밀번호"]').type('cypress0909!!'); | ||
// cy.get('[data-cy="login-button"]').click(); | ||
// submit login | ||
cy.wait(500); | ||
cy.get('[data-cy="main-profile"]').should('be.visible').click(); | ||
|
||
// logout | ||
cy.wait(500); | ||
cy.get('[data-cy="profile-logout"]').click(); | ||
cy.get('[data-cy="main-profile"]').should('not.exist'); | ||
// cy.wait(500); | ||
// cy.get('[data-cy="main-profile"]').should('be.visible').click(); | ||
// // logout | ||
// cy.wait(500); | ||
// cy.get('[data-cy="profile-logout"]').click(); | ||
// cy.get('[data-cy="main-profile"]').should('not.exist'); | ||
}); | ||
|
||
// goes to register page | ||
it('go to register', () => { | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.wait(500); | ||
// it('go to register', () => { | ||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.wait(500); | ||
|
||
// click register page | ||
cy.get('[data-cy="main-move-to-register"]').click(); | ||
cy.wait(500); | ||
// // click register page | ||
// cy.get('[data-cy="main-move-to-register"]').click(); | ||
// cy.wait(500); | ||
|
||
// check if register page is rendered | ||
cy.get('[data-cy="register-container"]').should('be.visible'); | ||
}); | ||
// // check if register page is rendered | ||
// cy.get('[data-cy="register-container"]').should('be.visible'); | ||
// }); | ||
|
||
// close login modal | ||
it('close login modal', () => { | ||
// click x to close | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.get('[data-cy="main-login-container"]').should('exist'); | ||
cy.wait(500); | ||
cy.get('[data-cy="main-login-close"]').click(); | ||
cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
// it('close login modal', () => { | ||
// // click x to close | ||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.get('[data-cy="main-login-container"]').should('exist'); | ||
// cy.wait(500); | ||
// cy.get('[data-cy="main-login-close"]').click(); | ||
// cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
|
||
// click outside of modal to close -> top | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.get('[data-cy="main-login-container"]') | ||
.should('exist') | ||
.should('be.visible'); | ||
cy.wait(500); | ||
cy.get('[data-cy="main-login-outer"]').click('top'); | ||
cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
// // click outside of modal to close -> top | ||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.get('[data-cy="main-login-container"]') | ||
// .should('exist') | ||
// .should('be.visible'); | ||
// cy.wait(500); | ||
// cy.get('[data-cy="main-login-outer"]').click('top'); | ||
// cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
|
||
// click outside of modal to close -> bottom | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.get('[data-cy="main-login-container"]') | ||
.should('exist') | ||
.should('be.visible'); | ||
cy.wait(500); | ||
cy.get('[data-cy="main-login-outer"]').click('bottom'); | ||
cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
// // click outside of modal to close -> bottom | ||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.get('[data-cy="main-login-container"]') | ||
// .should('exist') | ||
// .should('be.visible'); | ||
// cy.wait(500); | ||
// cy.get('[data-cy="main-login-outer"]').click('bottom'); | ||
// cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
|
||
// click outside of modal to close -> left | ||
cy.get('[data-cy="main-login-button"]').click(); | ||
cy.get('[data-cy="main-login-container"]') | ||
.should('exist') | ||
.should('be.visible'); | ||
cy.wait(500); | ||
cy.get('[data-cy="main-login-outer"]').click('left'); | ||
cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
}); | ||
// // click outside of modal to close -> left | ||
// cy.get('[data-cy="main-login-button"]').click(); | ||
// cy.get('[data-cy="main-login-container"]') | ||
// .should('exist') | ||
// .should('be.visible'); | ||
// cy.wait(500); | ||
// cy.get('[data-cy="main-login-outer"]').click('left'); | ||
// cy.get('[data-cy="main-login-container"]').should('not.exist'); | ||
// }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjIxMSwiZW1haWwiOiJjeXByZXNzQHNvbWEuY29tIiwiaWF0IjoxNjYzMzMyNzY5LCJleHAiOjE2NjM0MTkxNjl9.XuJ_8HU_1zvLncLr8OSkRKSihiQsiRgm3dfXecgJK8U" | ||
"access_token": "loginToken" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"uid": 211, | ||
"kakaoId": null, | ||
"googleId": null, | ||
"uid": 15, | ||
"createdAt": "2022-08-12T05:21:53.225Z", | ||
"updatedAt": "2022-10-24T18:34:29.631Z", | ||
"nickname": "람다", | ||
"email": "[email protected]", | ||
"status_quo": "안녕하세요, 코딩 그룻입니다", | ||
"avatar": 14, | ||
"github_link": "https://github.com/iamgroooooot", | ||
"blog_link": "https://coding-groot.tistory.com/", | ||
"groups": ["SWM13", "python korea", "test"], | ||
"badges": [], | ||
"verified": true, | ||
"githubId": null, | ||
"createdAt": "2022-09-16T06:47:23.152Z", | ||
"updatedAt": "2022-09-16T06:47:23.152Z", | ||
"nickname": "mockCypress", | ||
"email": "[email protected]", | ||
"avatar": 24 | ||
"googleId": null, | ||
"kakaoId": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,6 @@ | |
"githubId": null, | ||
"googleId": null, | ||
"kakaoId": null | ||
} | ||
}, | ||
"isPublic": true | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.