E2E Tests: Run tests against WP 5.9 RC1#10101
Conversation
|
@spacedmonkey Tests against RC 1 are failing now because of this change in core: https://core.trac.wordpress.org/ticket/54181 In So we need to make it a bit more robust. |
|
The We might want to consider installing/activating Twenty Twenty-One by default in |
How is that possible, we are using 2020 for e2e test ain't we? |
|
Ah, you're right. Then I suppose some selectors have simple changed.
Maybe |
|
I am converting this to a draft simply to avoid generating unnecessary Percy snapshots while this is WIP. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Pascal Birchler <pascalb@google.com>
| const isWelcomeGuideActive = await page.evaluate((version) => { | ||
| // TODO Change after 5.9 release. | ||
| if ('latest' === version) { | ||
| return wp.data | ||
| .select('core/edit-widgets') | ||
| .__unstableIsFeatureActive('welcomeGuide'); | ||
| } | ||
| return wp.data | ||
| .select('core/interface') | ||
| .isFeatureActive('core/edit-widgets', 'welcomeGuide'); | ||
| }, WPVersion); |
There was a problem hiding this comment.
Is the version check really needed? Didn't it work the way you had it before, by checking whether the functions exist?
There was a problem hiding this comment.
Sadly it didn't work the way I had it before. See https://github.com/google/web-stories-wp/runs/4728644759?check_suite_focus=true#step:11:11
There was a problem hiding this comment.
I would love another way around doing this check.
There was a problem hiding this comment.
Hmm sounds like all that is needed is some conditional check, perhaps easiest with optional chaining (?.) ,to avoid the isFeatureActive is not a function error.
// Disable welcome guide if it is enabled.
// The former selector is for WP < 5.9
const isWelcomeGuideActive = await page.evaluate(() => {
return wp.data.select('core/edit-widgets')?.__unstableIsFeatureActive?.('welcomeGuide') ||
wp.data.select( 'core/interface' )?.isFeatureActive?.( 'core/edit-widgets', 'welcomeGuide' );
});
if (isWelcomeGuideActive) {
// The former action is for WP < 5.9
await page.evaluate(() => {
wp.data.dispatch('core/edit-widgets')?.__unstableToggleFeature?.('welcomeGuide');
wp.data.dispatch( 'core/interface' )?.toggleFeature?.( 'core/edit-widgets', 'welcomeGuide' );
});
}
Context
Summary
Relevant Technical Choices
To-do
User-facing changes
Testing Instructions
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZlabel to the PRFixes #