fix test:e2e

This commit is contained in:
Andreani Jean
2023-12-12 10:47:01 +01:00
parent 2e2f23de69
commit be2cdbb62b
17 changed files with 1411 additions and 256 deletions

View File

@@ -1,25 +0,0 @@
describe('In the about page', () => {
it('go to the login page', () => {
cy.visit('partager-des-photos')
cy.fixture('about').then((aboutData: aboutInterface) => {
cy.contains(aboutData.textButtonAbout).click()
})
})
it('go to the login page', () => {
cy.visit('partager-des-photos')
cy.fixture('about').then((aboutData: aboutInterface) => {
cy.contains(aboutData.textButtonAbout).click()
})
})
it('go to the cli page', () => {
cy.visit('partager-des-photos')
cy.fixture('about').then((aboutData: aboutInterface) => {
cy.contains(aboutData.textButtonCli).click()
})
})
})
interface aboutInterface {
textButtonAbout: string
textButtonCli: string
}
export {}

View File

@@ -0,0 +1,23 @@
describe('In the contribute page', () => {
it('go to the login page', () => {
cy.visit('pourquoi-contribuer')
cy.fixture('contribute').then((contributeData: contributeInterface) => {
cy.contains(contributeData.textButtonContribute).click()
})
})
it('go to the doc pages', () => {
cy.visit('pourquoi-contribuer')
cy.fixture('contribute').then((contributeData: contributeInterface) => {
cy.contains(contributeData.textButtonDocCli).click()
cy.contains(contributeData.textButtonDoc).click()
cy.contains(contributeData.textButtonDocPython).click()
cy.contains(contributeData.textButtonCli).click()
cy.contains(contributeData.textButtonTiles).click()
})
})
})
interface contributeInterface {
textButtonContribute: string
textButtonCli: string
}
export {}

View File

@@ -1,33 +0,0 @@
describe('Testing the full user course', () => {
it('should access to the uploaded sequence and delete it', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
cy.fixture('login').then((loginData) => {
cy.get('#username').type('elysee')
cy.get('#password').type('my password')
cy.contains(loginData.textLinkLogin).click()
cy.visit('/')
})
cy.fixture('full-course').then((fullCourseData) => {
cy.contains(fullCourseData.uploadLink).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('.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()
})
})
})
})
export {}

View File

@@ -3,7 +3,7 @@ describe('In the home page', () => {
cy.visit('/')
cy.fixture('home').then((homeData) => {
cy.contains(homeData.textLinkAbout).click()
cy.url().should('include', '/partager-des-photos')
cy.url().should('include', '/pourquoi-contribuer')
})
})
it('click on the link in the header to go to the Login page', () => {

View File

@@ -3,10 +3,8 @@ describe('In the login page', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)
cy.get('#username').type('Elysee')
cy.get('#password').type('my password')
cy.fixture('upload').then((uploadData) => {
cy.contains(uploadData.textLinkLogin).click()
cy.visit('/')
})
cy.contains('Sign In').click()
cy.visit('/')
})
it('go to the register form and create an account', () => {
cy.visit(`${Cypress.env('api_url')}api/auth/login`)

View File

@@ -1,4 +0,0 @@
{
"textButtonAbout": "Créer un compte",
"textButtonCli": "Accéder à l'outil"
}

View File

@@ -0,0 +1,8 @@
{
"textButtonContribute": "+ Partager des images",
"textButtonDocCli": "Voir la documentation",
"textButtonDoc": "Retrouvez sa documentation ici",
"textButtonDocPython": "de python (au moins la version 3.8)",
"textButtonCli": "L'outil en ligne de commande",
"textButtonTiles": "de tuiles vectorielles"
}

View File

@@ -1,6 +0,0 @@
{
"uploadLink": "Contribuer",
"userName": "E",
"myPicturesLink": "Mes photos",
"deleteSequence": "Supprimer"
}

View File

@@ -1,5 +1,5 @@
{
"textLinkAbout": "À propos",
"textLinkUpload": "Contribuer",
"textLinkAbout": "Pourquoi contribuer ?",
"textLinkUpload": "Pourquoi contribuer ?",
"textLinkLogin": "Connexion"
}

View File

@@ -1,5 +0,0 @@
{
"textLinkLogin": "Sign In",
"textLinkUpload": "Contribuer",
"textButtonUpload": "Déposez des photos dans la zone ou"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

1551
yarn.lock

File diff suppressed because it is too large Load Diff