-
Notifications
You must be signed in to change notification settings - Fork 45
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
Electron tests: external links open an external browser #3373
Labels
Comments
jessfraz
added
tests
Pull requests that update or improve our test suite
desktop-app
Issues from the desktop app.
labels
Aug 12, 2024
I'm going to give this a quick try, but I don't think this is something we can test, once it opens an external browser it's out of our hands. |
I didn't have any luck, in case it's useful here's the code I tried test(
'external links',
{ tag: '@electron' },
async ({ browserName }, testInfo) => {
test.skip(
browserName === 'webkit',
'Skip on Safari because `window.tearDown` does not work'
)
const { electronApp, page } = await setupElectron({
testInfo,
folderSetupFn: async (dir) => {
await fsp.mkdir(`${dir}/router-template-slate`, { recursive: true })
await fsp.copyFile(
'src/wasm-lib/tests/executor/inputs/router-template-slate.kcl',
`${dir}/router-template-slate/main.kcl`
)
},
})
await page.goto('http://localhost:3000/')
await page.setViewportSize({ width: 1200, height: 500 })
page.on('console', console.log)
await expect(page.getByTestId('user-sidebar-toggle')).toBeVisible()
await page.getByTestId('user-sidebar-toggle').click()
// await page.getByText('Request a feature').click()
const [newPage] = await Promise.all([
page.waitForEvent('popup'),
page.getByText('Request a feature').click()
])
await newPage.waitForLoadState()
// can I verify it open it in the the default browser?
// await page.waitForTimeout(5000)
await electronApp.close()
}
) Maybe @ryanrosello-og will have an idea? |
I'll have to try this locally and see the error being logged |
jessfraz
changed the title
Electron tests: external links open an external browser (potentially unnecessary)
Electron tests: external links open an external browser
Aug 21, 2024
15 tasks
Merged
Merged
Merged
This was referenced Oct 24, 2024
Closed
Merged
Merged
Merged
Merged
Merged
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
When an external link is clicked it should start the system browser and not another electron window.
The test can click one of the following to test this:
This test may be unnecessary because the "failure" state looks like an electron window opening instead with the content, which isn't so bad. There are a lot of links in the application and it'd be high cost to maintain a test suite just for those alone.
@Irev-Dev or @jessfraz feel free to close
The text was updated successfully, but these errors were encountered: