forked from infoshareacademy/jfdzr12-project-react
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fccc41
commit b724fb4
Showing
9 changed files
with
133 additions
and
0 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,29 @@ | ||
# Projekt: Testy E2E | ||
|
||
Na potrzeby przeprowadzenia testów w katalogu [`dummy`](../../dummy) stworzona została przykładowa aplikacja, a w | ||
katalogu [`dummy-e2e`](../../dummy-e2e) projekt testów E2E. | ||
|
||
Przed przystąpieniem do zadań koniecznie zainstaluj zależności w obu projektach, a następnie uruchom aplikację _Dummy_ ( | ||
jest wymagana do przeprowadzenia testów). | ||
|
||
Wszelkie ścieżki podane poniżej są relatywne dla katalogu wspomnianego projektu - [`dummy-e2e`](../../dummy-e2e). | ||
|
||
--- | ||
|
||
Aplikację _Dummy_ uruchom z poziomu katalogu [`dummy`](../../dummy) poleceniem `npm run dev`. | ||
|
||
Konsolę Cypress możesz otworzyć z poziomu katalogu [`dummy-e2e`](../../dummy-e2e) poleceniem `npm run open`. | ||
|
||
Testy E2E możesz też uruchomić z poziomu katalogu [`dummy-e2e`](../../dummy-e2e) poleceniem `npm run e2e`. | ||
|
||
--- | ||
|
||
## Strona logowania | ||
|
||
W pliku [`cypress/e2e/sign-in.cy.ts`](../../dummy-e2e/cypress/e2e/sign-in.cy.ts) napisz testy funkcjonalne strony | ||
logowania. | ||
|
||
## Profil użytkownika | ||
|
||
W pliku [`cypress/e2e/account.cy.ts`](../../dummy-e2e/cypress/e2e/account.cy.ts) napisz testy funkcjonalne strony | ||
profilu użytkownika. |
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,10 @@ | ||
const {defineConfig} = require("cypress"); | ||
|
||
module.exports = defineConfig({ | ||
e2e: { | ||
baseUrl: 'http://localhost:5173', | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
}); |
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 @@ | ||
describe('account page', () => { | ||
it('should contain greeting', () => { | ||
}) | ||
it('should log user out', () => { | ||
}) | ||
}) |
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,14 @@ | ||
describe('sign-in page', () => { | ||
it('should be opened by default', () => { | ||
cy.visit('/') | ||
}) | ||
it('should show invalid email error', () => { | ||
cy.visit('/sign-in') | ||
}) | ||
it('should show invalid password error', () => { | ||
cy.visit('/sign-in') | ||
}) | ||
it('should navigate to /account', () => { | ||
cy.visit('/sign-in') | ||
}) | ||
}) |
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,25 @@ | ||
// *********************************************** | ||
// This example commands.js 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) => { ... }) |
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.js 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,12 @@ | ||
{ | ||
"name": "dummy-e2e", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"open": "cypress open", | ||
"e2e": "cypress run" | ||
}, | ||
"devDependencies": { | ||
"cypress": "^13.6.6", | ||
"typescript": "^5.3.3" | ||
} | ||
} |
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": "es2022", | ||
"lib": [ | ||
"es2022", | ||
"dom" | ||
], | ||
"types": [ | ||
"cypress", | ||
"node" | ||
] | ||
}, | ||
"include": [ | ||
"**/*.ts" | ||
] | ||
} |