-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cascading: main into release/12.0.0-next (#2732)
## Proposed change <!-- Please include a summary of the changes and the related issue. Please also include relevant motivation and context. --> ## Related issues <!-- Please make sure to follow the [contribution guidelines](https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md) --> *- No issue associated -* <!-- * 🐛 Fix #issue --> <!-- * 🐛 Fix resolves #issue --> <!-- * 🚀 Feature #issue --> <!-- * 🚀 Feature resolves #issue --> <!-- * Pull Request #issue -->
- Loading branch information
Showing
140 changed files
with
3,731 additions
and
3,202 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
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
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
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,3 +1,9 @@ | ||
# Build | ||
/dist | ||
/dist-test | ||
/chrome-extension.zip | ||
|
||
# Playwright | ||
dist-e2e-playwright | ||
playwright-reports | ||
test-results |
15 changes: 15 additions & 0 deletions
15
apps/chrome-devtools/e2e-playwright/playwright-config.sanity.ts
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as path from 'node:path'; | ||
import { | ||
defineConfig, | ||
} from '@playwright/test'; | ||
import { | ||
default as defaultConfig, | ||
} from './playwright-config'; | ||
|
||
const config = defineConfig({ | ||
...defaultConfig, | ||
testDir: path.join(__dirname, 'sanity'), | ||
testMatch: /.*\.e2e\.ts$/ | ||
}); | ||
|
||
export default 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as path from 'node:path'; | ||
import { | ||
adjustPath, | ||
} from '@o3r/testing/tools/path-replacement'; | ||
import { | ||
defineConfig, | ||
} from '@playwright/test'; | ||
|
||
adjustPath('playwright'); | ||
|
||
const reportsFolder = path.join(__dirname, '..', 'playwright-reports'); | ||
|
||
const config = defineConfig({ | ||
testDir: path.join(__dirname, '..', 'e2e-playwright'), | ||
testMatch: /.*\.e2e-playwright-spec.ts$/, | ||
snapshotPathTemplate: '{testDir}/screenshots/{testFilePath}/{arg}{ext}', | ||
reporter: [ | ||
['list'], | ||
['junit', { outputFile: path.join(reportsFolder, 'junit', 'reporter.xml') }], | ||
['html', { open: 'never', outputFolder: path.join(reportsFolder, 'html') }] | ||
], | ||
retries: process.env.CI ? 3 : 0, | ||
forbidOnly: !!process.env.CI, | ||
navigationTimeout: 10_000, | ||
timeout: 60_000, | ||
use: { | ||
ignoreHTTPSErrors: true, | ||
screenshot: 'only-on-failure', | ||
trace: 'retain-on-failure', | ||
launchOptions: {} | ||
}, | ||
expect: { | ||
toHaveScreenshot: { | ||
maxDiffPixelRatio: 0 | ||
} | ||
}, | ||
projects: [ | ||
{ | ||
name: 'Chromium', | ||
use: { | ||
browserName: 'chromium', | ||
channel: 'chromium' | ||
} | ||
} | ||
] | ||
}); | ||
|
||
export default config; |
15 changes: 15 additions & 0 deletions
15
apps/chrome-devtools/e2e-playwright/sanity/install-sanity.e2e.ts
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { | ||
expect, | ||
} from '@playwright/test'; | ||
import { | ||
test, | ||
} from '../test-with-extension'; | ||
|
||
const EXTENSION_ID = 'aejabgendbpckkdnjaphhlifbhepmbne'; | ||
|
||
test.describe('Install extension to chrome', () => { | ||
test('Background service worker', ({ extensionServiceWorker, extensionId }) => { | ||
expect(extensionServiceWorker).toBeDefined(); | ||
expect(extensionId).toBe(EXTENSION_ID); | ||
}); | ||
}); |
12 changes: 12 additions & 0 deletions
12
apps/chrome-devtools/e2e-playwright/scenarios/dummy-scenario.e2e-playwright-spec.ts
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { | ||
expect, | ||
} from '@playwright/test'; | ||
import { | ||
test, | ||
} from '../test-with-extension'; | ||
|
||
test.describe('Dummy scenario', () => { | ||
test('Dummy test', () => { | ||
expect(true).toBe(true); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
apps/chrome-devtools/e2e-playwright/test-with-extension.ts
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import path from 'node:path'; | ||
import { | ||
test as base, | ||
type BrowserContext, | ||
chromium, | ||
type Worker, | ||
} from '@playwright/test'; | ||
|
||
const pathToExtension = path.resolve(__dirname, '..', 'dist'); | ||
|
||
/** | ||
* Extends playwright test to add extension access | ||
*/ | ||
export const test = base.extend<{ | ||
context: BrowserContext; | ||
extensionServiceWorker: Worker; | ||
extensionId: string; | ||
}>({ | ||
// eslint-disable-next-line no-empty-pattern -- Required for dependency injection | ||
context: async ({}, use) => { | ||
const context = await chromium.launchPersistentContext('', { | ||
channel: 'chromium', | ||
args: [ | ||
`--disable-extensions-except=${pathToExtension}`, | ||
`--load-extension=${pathToExtension}` | ||
] | ||
}); | ||
await use(context); | ||
await context.close(); | ||
}, | ||
extensionServiceWorker: async ({ context }, use) => { | ||
let [background] = context.serviceWorkers(); | ||
if (!background) { | ||
background = await context.waitForEvent('serviceworker'); | ||
} | ||
await use(background); | ||
}, | ||
extensionId: async ({ extensionServiceWorker }, use) => { | ||
const extensionId = extensionServiceWorker.url().split('/')[2]; | ||
await use(extensionId); | ||
} | ||
}); |
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.