Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger CI for #928 #937

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions commands/playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ module.exports = {
activeTabName() {
return activeTabName;
},
async metamaskExtensionId() {
const metamaskExtensionData = (await module.exports.getExtensionsData())
.metamask;
return metamaskExtensionData.id;
},
async setExpectInstance(expect) {
expectInstance = expect;
},
Expand Down Expand Up @@ -87,8 +92,7 @@ module.exports = {
return true;
},
async assignWindows() {
const metamaskExtensionData = (await module.exports.getExtensionsData())
.metamask;
const metamaskExtensionId = await module.exports.metamaskExtensionId();

let pages = await browser.contexts()[0].pages();
for (const page of pages) {
Expand All @@ -97,21 +101,21 @@ module.exports = {
} else if (
page
.url()
.includes(`chrome-extension://${metamaskExtensionData.id}/home.html`)
.includes(`chrome-extension://${metamaskExtensionId}/home.html`)
) {
metamaskWindow = page;
} else if (
page
.url()
.includes(
`chrome-extension://${metamaskExtensionData.id}/notification.html`,
`chrome-extension://${metamaskExtensionId}/notification.html`,
)
) {
metamaskNotificationWindow = page;
} else if (
page
.url()
.includes(`chrome-extension://${metamaskExtensionData.id}/popup.html`)
.includes(`chrome-extension://${metamaskExtensionId}/popup.html`)
) {
metamaskPopupWindow = page;
}
Expand Down Expand Up @@ -161,16 +165,15 @@ module.exports = {
return true;
},
async switchToMetamaskNotification() {
const metamaskExtensionData = (await module.exports.getExtensionsData())
.metamask;
const metamaskExtensionId = await module.exports.metamaskExtensionId();

let pages = await browser.contexts()[0].pages();
for (const page of pages) {
if (
page
.url()
.includes(
`chrome-extension://${metamaskExtensionData.id}/notification.html`,
`chrome-extension://${metamaskExtensionId}/notification.html`,
)
) {
metamaskNotificationWindow = page;
Expand Down Expand Up @@ -337,16 +340,13 @@ module.exports = {
}
},
async waitUntilStable(page) {
const metamaskExtensionData = (await module.exports.getExtensionsData())
.metamask;
const metamaskExtensionId = await module.exports.metamaskExtensionId();

if (
page &&
page
.url()
.includes(
`chrome-extension://${metamaskExtensionData.id}/notification.html`,
)
.includes(`chrome-extension://${metamaskExtensionId}/notification.html`)
) {
await page.waitForLoadState('load');
await page.waitForLoadState('domcontentloaded');
Expand Down Expand Up @@ -477,7 +477,7 @@ module.exports = {

const extensionId = (
await extensionData.locator('#extension-id').textContent()
).replace('ID: ', '');
).split(': ')[1];

extensionsData[extensionName] = {
version: extensionVersion,
Expand Down