-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changelog : - [Hotfix] fix migration errors #350 - [Hotfix] disable Sentry performance monitoring #349 - [Aide à la saisie] set float as answer value and set total km instead of "real" km to be consistent with the model (NGC-389) #348
- Loading branch information
1 parent
aaf04ae
commit 16e7616
Showing
12 changed files
with
184 additions
and
90 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
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,69 +1,106 @@ | ||
import { | ||
clickAmisLink, | ||
clickSkipTutorialButton, | ||
} from '../../../helpers/elements/buttons' | ||
import { clickSkipTutorialButton } from '../../../helpers/elements/buttons' | ||
import { recursivelyFillSimulation } from '../../../helpers/simulation/recursivelyFillSimulation' | ||
|
||
describe( | ||
'The Group creation page /amis/creer', | ||
{ testIsolation: false }, | ||
() => { | ||
it('allows to create a new group and displays it afterwards', () => { | ||
cy.visit('/amis') | ||
describe('The Group creation page /amis/creer', () => { | ||
let ownerUserId = '' | ||
|
||
cy.clearLocalStorage() | ||
it('allows to create a new group and displays it afterwards', () => { | ||
cy.visit('/amis') | ||
|
||
// Check that we can create our first group | ||
cy.get('[data-cypress-id="button-create-first-group"]').click() | ||
cy.get('input[data-cypress-id="group-input-owner-name"]').type( | ||
'Jean-Marc' | ||
) | ||
cy.get('[data-cypress-id="button-create-group"]').click() | ||
cy.clearLocalStorage() | ||
|
||
// Fill simulation | ||
clickSkipTutorialButton() | ||
recursivelyFillSimulation(null, 'group') | ||
// Check that we can create our first group | ||
cy.get('[data-cypress-id="button-create-first-group"]').click() | ||
cy.get('input[data-cypress-id="group-input-owner-name"]').type('Jean-Marc') | ||
cy.get('[data-cypress-id="button-create-group"]').click() | ||
|
||
cy.get('[data-cypress-id="group-name"]') | ||
cy.wait(2000) | ||
|
||
// Check that we can create a second group | ||
clickAmisLink() | ||
cy.get('[data-cypress-id="button-create-other-group"]').click() | ||
// Fill simulation | ||
clickSkipTutorialButton() | ||
|
||
cy.get('input[data-cypress-id="group-input-owner-name"]').clear() | ||
cy.wait(2000) | ||
|
||
cy.get('input[data-cypress-id="group-input-owner-name"]').type( | ||
'Jean-Marc groupe 2' | ||
) | ||
cy.get('[data-cypress-id="button-create-group"]').click() | ||
cy.get('[data-cypress-id="group-name"]') | ||
recursivelyFillSimulation(null, 'group') | ||
|
||
// And that we can update its name | ||
cy.get('[data-cypress-id="group-name-edit-button"]').click() | ||
cy.wait(4000) | ||
|
||
const newName = 'Les amis de Jean-Marc' | ||
cy.get('[data-cypress-id="group-name"]') | ||
|
||
cy.get('input[data-cypress-id="group-edit-input-name"]').clear() | ||
cy.get('input[data-cypress-id="group-edit-input-name"]').type(newName) | ||
cy.get('[data-cypress-id="button-inline-input"]').click() | ||
cy.get('[data-cypress-id="group-name"]').contains(newName) | ||
// And that we can delete it | ||
cy.get('[data-cypress-id="button-delete-group"]').click() | ||
cy.get('[data-cypress-id="button-confirm-delete-group"]').click() | ||
|
||
// Check that we can create a second group | ||
cy.wait(2000) | ||
|
||
cy.get('[data-cypress-id="button-create-first-group"]').click() | ||
|
||
cy.get('input[data-cypress-id="group-input-owner-name"]').clear() | ||
|
||
cy.get('input[data-cypress-id="group-input-owner-name"]').type( | ||
'Jean-Marc groupe 2' | ||
) | ||
cy.get('[data-cypress-id="button-create-group"]').click() | ||
cy.get('[data-cypress-id="group-name"]') | ||
|
||
// And that we can update its name | ||
cy.get('[data-cypress-id="group-name-edit-button"]').click() | ||
|
||
const newName = 'Les amis de Jean-Marc' | ||
|
||
cy.get('input[data-cypress-id="group-edit-input-name"]').clear() | ||
cy.get('input[data-cypress-id="group-edit-input-name"]').type(newName) | ||
cy.get('[data-cypress-id="button-inline-input"]').click() | ||
cy.get('[data-cypress-id="group-name"]').contains(newName) | ||
|
||
// Save the owner user id in order to be able to delete the group later on | ||
cy.getAllLocalStorage().then((result) => { | ||
ownerUserId = | ||
result[Cypress.config('baseUrl')]?.['nosgestesclimat::v3'] && | ||
JSON.parse(result[Cypress.config('baseUrl')]?.['nosgestesclimat::v3']) | ||
?.user?.id | ||
}) | ||
|
||
it('allows to join a group with the invitation link and display ', () => { | ||
cy.clearLocalStorage() | ||
cy.reload() | ||
cy.clearLocalStorage() | ||
cy.reload() | ||
|
||
cy.wait(3000) | ||
|
||
cy.get('[data-cypress-id="member-name"]').type('Jean-Claude') | ||
cy.get('[data-cypress-id="button-join-group"]').click() | ||
|
||
clickSkipTutorialButton() | ||
recursivelyFillSimulation(null, 'group') | ||
|
||
cy.wait(3000) | ||
|
||
cy.get('[data-cypress-id="group-name"]') | ||
|
||
// Check that the main sections are displayed | ||
cy.get('[data-cypress-id="points-fort-faibles-title"]') | ||
cy.get('[data-cypress-id="votre-empreinte-title"]') | ||
|
||
let currentUrl = '' | ||
|
||
cy.get('[data-cypress-id="member-name"]').type('Jean-Claude') | ||
cy.get('[data-cypress-id="button-join-group"]').click() | ||
// Delete the group via the API | ||
cy.url().then((url) => { | ||
currentUrl = url | ||
|
||
clickSkipTutorialButton() | ||
recursivelyFillSimulation(null, 'group') | ||
const groupId = currentUrl?.split('groupId=')?.[1] | ||
|
||
cy.get('[data-cypress-id="group-name"]') | ||
const SERVER_URL = Cypress.env('server_url') | ||
|
||
// Check that the main sections are displayed | ||
cy.get('[data-cypress-id="points-fort-faibles-title"]') | ||
cy.get('[data-cypress-id="votre-empreinte-title"]') | ||
cy.request( | ||
'POST', | ||
`http${ | ||
SERVER_URL === 'localhost:3001' ? '' : 's' | ||
}://${SERVER_URL}/group/delete`, | ||
{ | ||
groupId, | ||
userId: ownerUserId, | ||
} | ||
).as('response') | ||
}) | ||
} | ||
) | ||
}) | ||
}) |
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,5 +1,7 @@ | ||
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin') | ||
|
||
module.exports = (on, config) => { | ||
config.env = process.env | ||
|
||
addMatchImageSnapshotPlugin(on, config) | ||
} |
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 |
---|---|---|
|
@@ -7,12 +7,13 @@ import * as Sentry from '@sentry/nextjs' | |
Sentry.init({ | ||
dsn: 'https://[email protected]/118', | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.05, | ||
enableTracing: false, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
|
||
sampleRate: 0.1, | ||
|
||
replaysOnErrorSampleRate: 1.0, | ||
|
||
// This sets the sample rate to be 10%. You may want this to be 100% while | ||
|
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 |
---|---|---|
|
@@ -8,9 +8,10 @@ import * as Sentry from '@sentry/nextjs' | |
Sentry.init({ | ||
dsn: 'https://[email protected]/118', | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.05, | ||
enableTracing: false, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
|
||
sampleRate: 0.1, | ||
}) |
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 |
---|---|---|
|
@@ -7,12 +7,13 @@ import * as Sentry from '@sentry/nextjs' | |
Sentry.init({ | ||
dsn: 'https://[email protected]/118', | ||
|
||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.05, | ||
enableTracing: false, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
|
||
sampleRate: 0.1, | ||
|
||
// Disable sentry for development based on local data | ||
enabled: !process.env.NEXT_PUBLIC_LOCAL_DATA, | ||
}) |
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 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
Oops, something went wrong.