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

Wip/farmaazon/chromatic in package tests #12338

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Frizi
Copy link
Contributor

@Frizi Frizi commented Feb 20, 2025

Pull Request Description

Fixes #11710

Improved visual stability of electron testing scenario, reworked the electron-based test definition to use API that's compatible with chromatic snapshots. Added upload of snapshots, though they are not yet verified as required for PRs due to still existing visual stability issues.

Copy link

github-actions bot commented Feb 20, 2025

🧪 Storybook is successfully deployed!

📊 Dashboard:

Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds over 1000 more lines to pnpm-lock.yaml. After reviewing it briefly, I discovered duplicated webpack (different versions) and duplicated storybook (same versions but different deps). May you take a look if we could improve that?

Comment on lines +49 to +52
/**
* Setup for all tests: checks if and where electron exec is.
* @throws when no Enso package could be found.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this docs still relevant? To me all fields (testRunId, projectsDir) have something from being "setup"

Comment on lines +87 to +88
await page.mouse.move(0, 0) // Avoid showing a tooltip
await expect(page.locator('.GraphEditor .GraphNode.pending')).toHaveCount(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check may pass before finishing execution, because we may run this check before the first "pending" updates arrive from the engine.

We may add expectation to have some node non-pending first, but I'm not sure how it would behave in really fast computations.

'Didn\'t see the visualization update after "Write once" action; assuming it\'s already done',
)
}
await expect(writeNode.locator('.TableVisualization')).toContainText(OUTPUT_FILE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the above, I still think this check is flaky and keep the try/catch.

@@ -106,6 +119,9 @@ electronTest('Local Workflow', async ({ page, app, projectsDir }) => {
expect(projectFiles).toContain('images')
const images = await fs.readdir(pathModule.join(PROJECT_PATH, 'images'))
expect(images).toContain('image.png')
await expect(page.locator('.GraphEditor .GraphNode.pending')).toHaveCount(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a strange check - we don't touch code after last such check - if it's needed, please add info why.

@@ -164,6 +164,9 @@
"@types/ws": "*"
}
}
},
"patchedDependencies": {
"@chromatic-com/playwright": "patches/@chromatic-com__playwright.patch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we set exact version requirement on chromatic dependency if we patch it?

Comment on lines +70 to +81
const __browserFn = innerPage.context().browser
Object.defineProperty(innerPage.context(), 'browser', {
value: function browser() {
return (
__browserFn.apply(this) ?? {
browserType: () => ({
name: () => 'chromium',
}),
}
)
},
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why double underscore?
  2. Why this is needed? Could you add a comment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screenshot testing in package tests.
2 participants