-
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.
Configure Cypress for local UI testing (#8)
- Loading branch information
1 parent
03af151
commit 9ec1356
Showing
9 changed files
with
877 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { loadEnvConfig } from '@next/env'; | ||
import { defineConfig } from 'cypress'; | ||
|
||
const { combinedEnv } = loadEnvConfig(process.cwd()); | ||
export default defineConfig({ | ||
env: combinedEnv, | ||
e2e: { | ||
baseUrl: 'http://localhost:3000', | ||
retries: { | ||
runMode: 3, | ||
}, | ||
viewportHeight: 1080, | ||
viewportWidth: 1920, | ||
video: false, | ||
screenshotOnRunFailure: false, | ||
}, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/// <reference types="cypress" /> | ||
|
||
describe('Login Page', () => { | ||
beforeEach(() => { | ||
cy.visit('/login'); | ||
}); | ||
|
||
it('Can login with valid credentials', () => { | ||
cy.fixture('accounts').then(accounts => { | ||
const { admin } = accounts; | ||
cy.get('input[name="email"]').type(admin.username); | ||
cy.get('input[name="password"]').type(admin.password); | ||
cy.contains('Sign In').click(); | ||
|
||
cy.location().should(loc => { | ||
expect(loc.pathname).to.eq('/'); | ||
}); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"admin": { | ||
"username": "[email protected]", | ||
"password": "password" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/e2e.ts is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands'; | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": [ | ||
"es5", | ||
"dom" | ||
], | ||
"types": [ | ||
"cypress", | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"**/*.ts" | ||
] | ||
} |
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.
9ec1356
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
membership-portal-ui-v2 – ./
membership-portal-ui-v2-git-main-acmucsd.vercel.app
v2.members.acmucsd.com
membership-portal-ui-v2-acmucsd.vercel.app
membership-portal-ui-v2.vercel.app