-
Notifications
You must be signed in to change notification settings - Fork 179
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
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 <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would love another way around doing this check.
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.
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: XYZ
label to the PRFixes #