Files
Umbraco-CMS/tests/Umbraco.Tests.AcceptanceTest/cypress/integration/HelpPanel/systemInformation.ts
Nikolaj Geisle 32d8e0bb96 v9: Fix tests on Linux (#11586)
* downgraded cypress, updated package

* Fixed language test

* Fix language test

* Fixed routing tests to wait for popup

* Publish test artifacts

* Added better element to wait on

* Fix routing tests for linux

* Fix language tests on linux

* Stablize tabs tests

* Implement waiting for inner tree like in content tests

* Assert that we are in settings section so we dont click an element that doesnt exist

* Fixed rollback by not doing cy.reload()

* Fix language test with correct wait

* Stabilize dataTypes by moving API Call, and stabilize systemInformation.ts test by waiting for success notification

* Fix dataTypes, tabs and template tests

* Update node to newer version in package-lock.json and fix template test

* Implemented cy.wait to test if it is because we are too fast

* Added comments

* Bigger wait

* Try another wait instead of magic numbers

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2021-11-15 14:20:10 +01:00

46 lines
1.7 KiB
TypeScript

/// <reference types="Cypress" />
function openSystemInformation(){
//We have to wait for page to load, if the site is slow
cy.get('[data-element="global-help"]').should('be.visible').click();
cy.get('.umb-help-list-item').last().should('be.visible').click();
cy.get('.umb-drawer-content').scrollTo('bottom', {ensureScrollable : false});
}
context('System Information', () => {
beforeEach(() => {
//arrange
cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
cy.umbracoSetCurrentUserLanguage('en-US');
});
afterEach(() => {
cy.umbracoSetCurrentUserLanguage('en-US');
});
it('Check System Info Displays', () => {
openSystemInformation();
cy.get('.table').find('tr').should('have.length', 10);
cy.contains('Current Culture').parent().should('contain', 'en-US');
cy.contains('Current UI Culture').parent().should('contain', 'en-US');
});
it('Checks language displays correctly after switching', () => {
//Navigate to edit user and change language
cy.umbracoGlobalUser().click();
cy.get('[alias="editUser"]').click();
cy.get('[name="culture"]').select('string:da-DK', { force: true});
cy.umbracoButtonByLabelKey('buttons_save').click({force: true});
cy.umbracoSuccessNotification().should('be.visible');
openSystemInformation();
//Assert
cy.contains('Current Culture').parent().should('contain', 'da-DK');
cy.contains('Current UI Culture').parent().should('contain', 'da-DK');
cy.get('.umb-button__content').last().click();
//Clean
cy.umbracoSetCurrentUserLanguage('en-US');
});
});