-
Notifications
You must be signed in to change notification settings - Fork 87
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
Integrate visual testing mechanism to the latest KDS version #901
Integrate visual testing mechanism to the latest KDS version #901
Conversation
…sting Percy and jest-puppeteer environment setup for visual testing
…or custom describe blocks
…ncurrently Replace custom checks from the server script to use concurrently
…ction Add abstraction logic for simplifying writing visual tests
Implement visual tests for KButton component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, but nothing blocking that I can see from a quick pass
yarn --frozen-lockfile | ||
npm rebuild node-sass | ||
- name: Download Chromium | ||
run: npx puppeteer browsers install chrome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious if this is cached, and if not, if we should
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jest.conf/visual.index.js
Outdated
@@ -0,0 +1,121 @@ | |||
const path = require('node:path'); | |||
const http = require('http'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be node:http
@@ -64,4 +65,106 @@ describe('KButton', () => { | |||
expect(wrapper.emitted().click).toBeTruthy(); | |||
}); | |||
}); | |||
|
|||
describe.visual('KButton Visual Tests', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose Visual
in the string is redundant with what describe.visual
does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just make it KButton Tests
in that case 👍
@@ -60,7 +60,7 @@ require('./grids/globalStyles.js'); // global grid styles | |||
* Also, set up global state, listeners, and styles. | |||
*/ | |||
export default function KThemePlugin(Vue) { | |||
if (!isNuxtServerSideRendering()) { | |||
if (!isNuxtServerSideRendering() && process.env.VISUAL_TESTING !== 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldnt we install the KThemePlugin while running visual tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the introduction of KLiveRegion and the changes in the KThemePlugin, if we try to run visual tests, the variable 'document' will become undefined as for it to work as intended, we require a jsdom test environment. This will result in errors in visual test execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks! Lets merge it, let it run and then if we need to activate it, we can look for alternatives. Thanks!
Thanks a lot for all your hard work @KshitijThareja!!! Merging! 🎉 🎉 🎉. |
Hey @KshitijThareja @bjester, we are getting this error on the execution. Do you have any idea why could it be happening? https://github.com/learningequality/kolibri-design-system/actions/runs/13038589590/job/36375439798 |
@AlexVelezLl ChatGPT says to possibly try using |
Hi @AlexVelezLl @bjester |
Sounds like
|
Description
This PR aims to integrate the visual testing mechanism to the latest version of KDS and ensure its proper working by implementing necessary changes.
Changelog
Testing checklist
Reviewer guidance