Skip to content

Commit 6a3ef19

Browse files
Revert "ofava/vidsol-291-header"
This reverts commit c08275d. ofava/vidsol-291-header Revert de49b37
1 parent a896732 commit 6a3ef19

File tree

7 files changed

+97
-8
lines changed

7 files changed

+97
-8
lines changed

.github/ISSUE_TEMPLATE/1-bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ body:
4646
- Chrome
4747
- Firefox
4848
- Microsoft Edge
49+
- Opera
4950
- Safari
5051
- Electron
5152

.github/workflows/run-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,17 @@ jobs:
7474
/opt/firefox/firefox --version
7575
echo "Firefox latest downloaded and installed"
7676
77+
- name: Install opera latest
78+
run: |
79+
sudo mkdir -p /etc/apt/keyrings
80+
curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor | sudo tee /etc/apt/keyrings/opera.gpg > /dev/null
81+
echo "deb [signed-by=/etc/apt/keyrings/opera.gpg] https://deb.opera.com/opera-stable/ stable non-free" | \
82+
sudo tee /etc/apt/sources.list.d/opera-stable.list > /dev/null
83+
sudo apt-get update
84+
sudo apt-get install opera-stable -y
85+
echo "Check opera version"
86+
/usr/bin/opera --version
87+
7788
- name: Setup node
7889
if: steps.check-skip-ci.outputs.result == 'false'
7990
uses: actions/setup-node@v4

.github/workflows/update-screenshots.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ jobs:
7272
echo "Check firefox version"
7373
/opt/firefox/firefox --version
7474
echo "Firefox latest downloaded and installed"
75+
- name: install opera latest
76+
if: steps.check-update-screenshots.outputs.result == 'true'
77+
run: |
78+
sudo add-apt-repository 'deb https://deb.opera.com/opera-stable/ stable non-free'
79+
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add -
80+
sudo apt-get update
81+
sudo apt-get install opera-stable -y
82+
echo "Check opera version"
83+
/usr/bin/opera --version
84+
echo "Opera latest downloaded and installed"
7585
7686
- name: Checkout
7787
if: steps.check-update-screenshots.outputs.result == 'true'

integration-tests/fixtures/testWithLogging.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ const test = (() => {
5454
});
5555
}
5656

57+
if (projectType === 'Opera') {
58+
return baseTest.extend({
59+
page: async ({ context }, use) => {
60+
const page = await context.newPage();
61+
const loggedPage = addLogger(page, context);
62+
await use(loggedPage);
63+
await page.close();
64+
},
65+
});
66+
}
67+
5768
return baseTest.extend({
5869
page: async ({ page, context }, use) => {
5970
const loggedPage = addLogger(page, context);

integration-tests/globalSetup.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
11
/* eslint-disable @typescript-eslint/no-require-imports */
2+
const { chromium } = require('@playwright/test');
3+
const path = require('path');
4+
const { exec } = require('child_process');
25
const startElectronApp = require('./electronHelper');
36

47
module.exports = async () => {
8+
const isOperaProject = process.argv.some((arg) => arg.includes('--project=Opera'));
59
const isElectronProject = process.argv.some((arg) => arg.includes('--project=Electron'));
10+
const isMac = process.platform === 'darwin';
11+
const executablePath = isMac ? '/Applications/Opera.app/Contents/MacOS/Opera' : '/usr/bin/opera';
12+
if (isOperaProject) {
13+
const projectType = process.env.PROJECT_TYPE || 'Opera';
14+
process.env.PROJECT_TYPE = projectType;
15+
const operaPath = path.resolve(executablePath);
16+
17+
exec(`${operaPath} --remote-debugging-port=9222`, (err) => {
18+
if (err) {
19+
console.error(`Error starting Opera: ${err}`);
20+
}
21+
});
22+
23+
await new Promise((resolve) => setTimeout(resolve, 3000));
24+
25+
try {
26+
const browser = await chromium.connectOverCDP('http://127.0.0.1:9222');
27+
global.browser = browser;
28+
} catch (error) {
29+
console.error('Error connecting to Opera:', error);
30+
}
31+
}
632

733
if (isElectronProject) {
834
const projectType = process.env.PROJECT_TYPE || 'Electron';

integration-tests/playwright.config.ts

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const chromiumFlags = [
2020
const width = 1512;
2121
const height = 824;
2222

23+
const isMac = process.platform === 'darwin';
24+
25+
const executablePath = isMac ? '/Applications/Opera.app/Contents/MacOS/Opera' : '/usr/bin/opera';
26+
2327
const fakeDeviceChromiumFlags = [
2428
...chromiumFlags,
2529
// headless only on CI
@@ -57,7 +61,9 @@ export default defineConfig({
5761
...devices['Desktop Chrome'],
5862
viewport: { width, height },
5963
channel: 'chrome',
60-
launchOptions: { args: chromiumFlags },
64+
launchOptions: {
65+
args: chromiumFlags,
66+
},
6167
},
6268
},
6369
{
@@ -66,7 +72,9 @@ export default defineConfig({
6672
...devices['Desktop Chrome'],
6773
viewport: { width, height },
6874
channel: 'chrome',
69-
launchOptions: { args: fakeDeviceChromiumFlags },
75+
launchOptions: {
76+
args: fakeDeviceChromiumFlags,
77+
},
7078
},
7179
},
7280
{
@@ -102,20 +110,39 @@ export default defineConfig({
102110
...devices['Desktop Edge'],
103111
viewport: { width, height },
104112
channel: 'msedge',
105-
launchOptions: { args: fakeDeviceChromiumFlags },
113+
launchOptions: {
114+
args: fakeDeviceChromiumFlags,
115+
},
106116
},
107117
},
108118
{
109119
name: 'Mobile Chrome',
110-
use: { ...devices['Pixel 5'], launchOptions: { args: fakeDeviceChromiumFlags } },
120+
use: {
121+
...devices['Pixel 5'],
122+
launchOptions: {
123+
args: fakeDeviceChromiumFlags,
124+
},
125+
},
126+
},
127+
{
128+
name: 'Opera',
129+
use: {
130+
viewport: { width, height },
131+
launchOptions: {
132+
args: fakeDeviceChromiumFlags,
133+
executablePath,
134+
},
135+
},
111136
},
112137
{
113138
name: 'Electron',
114139
use: {
115140
launchOptions: {
116141
args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream'],
117142
},
118-
contextOptions: { viewport: { width, height } },
143+
contextOptions: {
144+
viewport: { width, height },
145+
},
119146
},
120147
},
121148
],

integration-tests/project.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cache": false,
1111
"options": {
1212
"cwd": "integration-tests",
13-
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
13+
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron' --update-snapshots"
1414
}
1515
},
1616
"updateScreenshots:": {
@@ -26,7 +26,10 @@
2626
},
2727
"postinstall": {
2828
"executor": "nx:run-commands",
29-
"options": { "cwd": "integration-tests", "command": "playwright install" }
29+
"options": {
30+
"cwd": "integration-tests",
31+
"command": "playwright install"
32+
}
3033
},
3134
"ts-check": {
3235
"executor": "nx:run-commands",
@@ -47,7 +50,7 @@
4750
"description": "Run playwright tests in all browsers",
4851
"options": {
4952
"cwd": "integration-tests",
50-
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
53+
"command": "playwright test --project='Google Chrome Fake Devices' --project=firefox --project='Opera' --project='Microsoft Edge' --project='Mobile Chrome' --project='Electron'"
5154
}
5255
},
5356
"test:": {

0 commit comments

Comments
 (0)