forked from Ivasoft/geovisio-website
add some test e2e
This commit is contained in:
35
cypress/e2e/full-course.cy.ts
Normal file
35
cypress/e2e/full-course.cy.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
describe('Testing the full user course', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
|
||||
cy.fixture('upload').then((uploadData) => {
|
||||
cy.get('#username').type('elysee')
|
||||
cy.get('#password').type('my password')
|
||||
cy.contains(uploadData.textLinkLogin).click()
|
||||
cy.visit('/')
|
||||
cy.contains(uploadData.textLinkUpload).click()
|
||||
})
|
||||
cy.get('.input-file').selectFile(
|
||||
[
|
||||
'cypress/fixtures/images/image1.JPG',
|
||||
'cypress/fixtures/images/image2.JPG',
|
||||
'cypress/fixtures/images/image3.JPG'
|
||||
],
|
||||
{ force: true }
|
||||
)
|
||||
cy.get('button[type=submit]').click()
|
||||
cy.get('button[type=button]').click()
|
||||
})
|
||||
it('should access to the uploaded sequence and delete it', () => {
|
||||
cy.get('.sequence-title').then(($span) => {
|
||||
const sequenceTitle = $span.text()
|
||||
cy.fixture('full-course').then((fullCourseData) => {
|
||||
cy.contains(fullCourseData.userName).click()
|
||||
cy.contains(fullCourseData.myPicturesLink).click()
|
||||
cy.contains(sequenceTitle).click()
|
||||
cy.contains(fullCourseData.deleteSequence).click()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
export {}
|
||||
@@ -1,5 +1,5 @@
|
||||
describe('In the login page', () => {
|
||||
it('type in the form to login', () => {
|
||||
describe('In upload page', () => {
|
||||
it('upload some pictures', () => {
|
||||
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
|
||||
cy.fixture('upload').then((uploadData) => {
|
||||
cy.get('#username').type('elysee')
|
||||
@@ -17,6 +17,7 @@ describe('In the login page', () => {
|
||||
{ force: true }
|
||||
)
|
||||
cy.get('button[type=submit]').click()
|
||||
cy.get('button[type=button]').click()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
5
cypress/fixtures/full-course.json
Normal file
5
cypress/fixtures/full-course.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"userName": "E",
|
||||
"myPicturesLink": "Mes photos",
|
||||
"deleteSequence": "Supprimer"
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"addressToSearch": "97 boulevard Voltaire 75011 paris",
|
||||
"textAddressToSelect": "Boulevard Voltaire, Quartier de la Folie-Méricourt, Paris 11e Arrondissement, Paris, Île-de-France, France métropolitaine, 75011, France",
|
||||
"textLinkAbout": "À propos",
|
||||
"textLinkUpload": "Contribuer",
|
||||
"textLinkLogin": "Connexion"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 133 KiB |
Reference in New Issue
Block a user