-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(cypress): improve cypress performances #47379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
49fa2e5
b6bc288
5a7e211
c0781f5
d3a0e83
5e2e2ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,11 +102,23 @@ const genericProperties = ['Location', 'X (formerly Twitter)', 'Fediverse'] | |
| const nonfederatedProperties = ['Organisation', 'Role', 'Headline', 'About'] | ||
|
|
||
| describe('Settings: Change personal information', { testIsolation: true }, () => { | ||
| let snapshot: string = '' | ||
|
|
||
| before(() => { | ||
| // ensure we can set locale and language | ||
| cy.runOccCommand('config:system:delete force_language') | ||
| cy.runOccCommand('config:system:delete force_locale') | ||
| cy.createRandomUser().then(($user) => { | ||
| user = $user | ||
| cy.modifyUser(user, 'language', 'en') | ||
| cy.modifyUser(user, 'locale', 'en_US') | ||
| }) | ||
|
|
||
| cy.wait(500) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seem arbitrary. Can't we wait for something more specific?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we'll standardise this a bit more in a followup.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? |
||
|
|
||
| cy.backupDB().then(($snapshot) => { | ||
| snapshot = $snapshot | ||
| }) | ||
| }) | ||
|
|
||
| after(() => { | ||
|
|
@@ -115,30 +127,31 @@ describe('Settings: Change personal information', { testIsolation: true }, () => | |
| }) | ||
|
|
||
| beforeEach(() => { | ||
| cy.createRandomUser().then(($user) => { | ||
| user = $user | ||
| cy.modifyUser(user, 'language', 'en') | ||
| cy.modifyUser(user, 'locale', 'en_US') | ||
| cy.login($user) | ||
| cy.visit('/settings/user') | ||
| }) | ||
| cy.login(user) | ||
| cy.visit('/settings/user') | ||
| cy.intercept('PUT', /ocs\/v2.php\/cloud\/users\//).as('submitSetting') | ||
| }) | ||
|
|
||
| afterEach(() => { | ||
| cy.restoreDB(snapshot) | ||
| }) | ||
|
|
||
| it('Can dis- and enable the profile', () => { | ||
| cy.visit(`/u/${user.userId}`) | ||
| cy.contains('h2', user.userId).should('be.visible') | ||
|
|
||
| cy.visit('/settings/user') | ||
| cy.contains('Enable profile').click() | ||
| handlePasswordConfirmation(user.password) | ||
| cy.wait('@submitSetting') | ||
|
|
||
| cy.visit(`/u/${user.userId}`, { failOnStatusCode: false }) | ||
| cy.contains('h2', 'Profile not found').should('be.visible') | ||
|
|
||
| cy.visit('/settings/user') | ||
| cy.contains('Enable profile').click() | ||
| handlePasswordConfirmation(user.password) | ||
| cy.wait('@submitSetting') | ||
|
|
||
| cy.visit(`/u/${user.userId}`, { failOnStatusCode: false }) | ||
| cy.contains('h2', user.userId).should('be.visible') | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.