You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenario: Shouldnot display the CPCSS banner to admin 2 if it was dismissed by admin 1
Given I have an unexpired account
And turn on 'CPCSS'
Then I must see the banner 'We highly recommend the updated Remove Unused CSS for a better CSS optimization. Load CSS Asynchronously is always available as a back-up.'
When click on 'Turn on Remove Unused CSS'
Then I must see the banner 'The Remove Unused CSS service is processing your pages'
When I connect as 'admin2'
And I go '/wp-admin/options-general.php?page=wprocket#file_optimization'
Then I must not see the banner 'We highly recommend the updated Remove Unused CSS for a better CSS optimization. Load CSS Asynchronously is always available as a back-up.'
Currently, at connect as admin2 , we are using the default credentials in config file
/**
* Performs Wordpress login action.
*
* @param user - Optional username for login. If not provided, a default user will be used.
* @return {Promise<void>}
*/
public auth = async (user: string | null = null): Promise<void> => {
if (!this.page.url().includes('wp-login.php')) {
await this.visitPage('wp-admin');
}
if (!await this.page.locator('#user_login').isVisible()) {
return;
}
// Check if the user argument is provided, and login accordingly
if (user !== null) {
await this.wpAdminLogin(user); // Assuming wpAdminLogin can accept a user argument
} else {
// If no user is provided, log in as a default user
await this.wpAdminLogin(); // Default login (possibly using a predefined admin)
}
}
Scenario:
Currently, at connect as admin2 , we are using the default credentials in config file
Suggested solution
1- In config file we define admin2 username and password
2- In https://github.com/wp-media/wp-rocket-e2e/blob/develop/utils/page-utils.ts#L336 we rewrite the function to accept user as argument and still can take nothing , for example
3- In
wp-rocket-e2e/utils/page-utils.ts
Line 78 in e43c0ea
for example:
The text was updated successfully, but these errors were encountered: