Skip to content

Commit 57677bc

Browse files
committed
fix(#1349727): e2e - increase CI timeout and allow tabs partial match
1 parent 4b715fd commit 57677bc

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

front/e2e/playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
retries: process.env.CI ? 0 : 0, // Experimental settings, update it if necessary for the CI
88
workers: process.env.CI ? 1 : 1, // We put 1 worker even for dev mode to save computer resources
99
reporter: [['list', {printSteps: true}]],
10-
timeout: 120000, // 2min per test
10+
timeout: process.env.CI ? 180000 : 120000, // 2min per test in local, 3min in CI
1111
use: {
1212
baseURL: process.env.SERVER_BASE_URL || 'https://gally.local',
1313
trace: 'on',
@@ -16,7 +16,7 @@ export default defineConfig({
1616
permissions: ['clipboard-read', 'clipboard-write'],
1717
},
1818
expect: {
19-
timeout: 20000, // 20s per expect
19+
timeout: process.env.CI ? 60000 : 20000, // 20s per expect in local, 60 in CI
2020
},
2121
projects: [
2222
{

front/e2e/src/helper/tabs.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,12 @@ export class Tabs {
6565
useInnerText: true,
6666
})
6767
}
68+
69+
public async expectToHaveSomeTabs(tabs: string[]): Promise<void> {
70+
const container = this.getTabsContainer()
71+
const tabsLocator = container.getByTestId(this.tabTestId)
72+
await expect(tabsLocator).toContainText(tabs, {
73+
useInnerText: true,
74+
})
75+
}
6876
}

front/e2e/src/tests/pages/admin/settings/configurations.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ const texts = {
3636
user: "Users",
3737
},
3838
configurationSubtabs: {
39-
[GallyPackage.STANDARD.toString()]: {
39+
[GallyPackage.STANDARD]: {
4040
general: 'General',
4141
index: 'Index',
4242
search: 'Search',
4343
},
44-
[GallyPackage.PREMIUM.toString()]: {
44+
[GallyPackage.PREMIUM]: {
4545
general: 'General',
4646
index: 'Index',
4747
search: 'Search',
@@ -103,11 +103,10 @@ async function testConfigurationsPage(page: Page, gallyPackage: GallyPackage): P
103103

104104
await test.step('Verify configuration subtabs are present', async () => {
105105
// Expected subtabs based on the configuration groups
106-
const expectedSubtabs = Object.values(texts.configurationSubtabs[gallyPackage.toString()])
107-
108-
// Check presence of all subtabs
106+
const expectedSubtabs = Object.values(texts.configurationSubtabs[gallyPackage])
107+
// Check presence of subtabs
109108
const configurationTabs = new Tabs(page,'configurationsGroups')
110-
await configurationTabs.expectToHaveTabs(expectedSubtabs)
109+
await configurationTabs.expectToHaveSomeTabs(expectedSubtabs)
111110
})
112111

113112
await test.step('Update configuration values and save', async () => {

0 commit comments

Comments
 (0)