fix: temporary disable flaky ui test

This commit is contained in:
Rainer Killinger
2022-10-11 16:50:33 +02:00
parent 3e831c1648
commit 6b9b1fa854
3 changed files with 117 additions and 114 deletions

View File

@@ -19,66 +19,67 @@
const probablyBadTranslationPattern =
/^\s*([a-z_]+|[A-Z_]+)\.(([a-z_]+|[A-Z_]+)\.)([a-z_]+|[A-Z_]+)$/;
describe('translations', function () {
for (const path of [
'settings',
'news',
[
'search',
() => {
cy.visit('/search');
cy.get('ion-searchbar').type('test');
cy.get('stapps-data-list-item').should('have.length.greaterThan', 1);
},
],
[
'context-menu',
() => {
cy.visit('/search');
cy.get('ion-searchbar').type('test');
cy.get('stapps-data-list-item').should('have.length.greaterThan', 1);
cy.get('ion-menu-button[menu=context]').click();
cy.get('stapps-context');
},
],
'map',
'feedback',
'about',
'canteen',
'catalog',
'schedule',
'dashboard',
[
'schedule add modal',
() => {
cy.visit('/schedule');
cy.get('ion-fab').click();
cy.get('ion-modal');
},
],
'profile',
'favorites',
] as [string, () => void][]) {
const name = Array.isArray(path) ? path[0] : path;
const method = Array.isArray(path) ? path[1] : undefined;
describe(name, function () {
it('should not contain failed translation paths', function () {
if (method) {
method();
} else {
cy.visit(`/${path}`);
}
cy.wait(500);
cy.get('ion-app *').each($element => {
const text = $element.text();
if (text) {
expect(text).not.to.match(probablyBadTranslationPattern);
}
});
});
});
}
});
// TODO: Reenable and stabilize tests
//describe('translations', function () {
// for (const path of [
// 'settings',
// 'news',
// [
// 'search',
// () => {
// cy.visit('/search');
// cy.get('ion-searchbar').type('test');
// cy.get('stapps-data-list-item').should('have.length.greaterThan', 1);
// },
// ],
// [
// 'context-menu',
// () => {
// cy.visit('/search');
// cy.get('ion-searchbar').type('test');
// cy.get('stapps-data-list-item').should('have.length.greaterThan', 1);
// cy.get('ion-menu-button[menu=context]').click();
// cy.get('stapps-context');
// },
// ],
// 'map',
// 'feedback',
// 'about',
// 'canteen',
// 'catalog',
// 'schedule',
// 'dashboard',
// [
// 'schedule add modal',
// () => {
// cy.visit('/schedule');
// cy.get('ion-fab').click();
// cy.get('ion-modal');
// },
// ],
// 'profile',
// 'favorites',
// ] as [string, () => void][]) {
// const name = Array.isArray(path) ? path[0] : path;
// const method = Array.isArray(path) ? path[1] : undefined;
//
// describe(name, function () {
// it('should not contain failed translation paths', function () {
// if (method) {
// method();
// } else {
// cy.visit(`/${path}`);
// }
//
// cy.wait(500);
//
// cy.get('ion-app *').each($element => {
// const text = $element.text();
// if (text) {
// expect(text).not.to.match(probablyBadTranslationPattern);
// }
// });
// });
// });
// }
//});