Skip to content

Commit 369d737

Browse files
committed
Merge branch 'develop' into fix/exclude-renew-and-upgrade-from-broken-link-checks
2 parents 9349e89 + 9920383 commit 369d737

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"src/common/deactivation.modal.ts",
2222
"src/common/safe.mode.disabled.options.check.ts",
2323
"src/common/safe.mode.disabled.options.ts",
24-
"src/support/steps/steps.ts",
2524
"utils/commands.ts",
2625
"utils/configurations.ts"
2726
]

src/features/cdn-banner.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: CDN banner
88
And I am on the page '/wp-admin/options-general.php?page=wprocket#page_cdn'
99

1010
Scenario: Should validate that CDN purchase banner is displayed
11-
Given I must see the banner 'High performance Content Delivery Network (CDN) with'
11+
Given I must see the banner using selector '#wpr-rocketcdn-cta'
1212
And I click on '.wpr-rocketcdn-open'
1313
Then I must see the banner 'Login in to your WP Rocket Account to continue' in iframe '#rocketcdn-iframe'
1414

src/support/steps/steps.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
* @requires {@link ../../../utils/configurations}
1111
*/
1212
import {expect} from "@playwright/test";
13-
import wp, {
13+
import {
1414
activatePlugin,
1515
setTransient
1616
} from "../../../utils/commands";
1717
import { ICustomWorld } from "../../common/custom-world";
1818
import {configurations} from "../../../utils/configurations";
1919
import {match} from "ts-pattern";
20-
21-
const { Given, When, Then } = require("@cucumber/cucumber");
20+
import { Given, When, Then } from "@cucumber/cucumber";
2221

2322
/**
2423
* Executes the step to set up a WP account based on the provided status.
@@ -32,6 +31,7 @@ Given('I have an {word} account', { timeout: 60 * 1000 }, async function (this:
3231
return
3332
}
3433

34+
/* eslint-disable @typescript-eslint/naming-convention */
3535
await setTransient('wp_rocket_customer_data', JSON.stringify({
3636
'ID' : 1,
3737
'firstname' : 'Rocket',
@@ -51,6 +51,7 @@ Given('I have an {word} account', { timeout: 60 * 1000 }, async function (this:
5151
'upgrade_infinite_url' : 'https://example.org/upgrade_infinite_url'
5252
}).replaceAll('"', '\\"')
5353
.replaceAll('}', '\\}'))
54+
/* eslint-enable @typescript-eslint/naming-convention */
5455

5556
await this.page.reload();
5657
});
@@ -69,6 +70,14 @@ Then('I must see the banner {string}', async function (this: ICustomWorld, text:
6970
await expect(this.page.getByText(text)).toBeVisible({ timeout: 15000 });
7071
});
7172

73+
/**
74+
* Executes the step to assert the visibility of a banner with specific selector.
75+
*/
76+
Then('I must see the banner using selector {string}', async function (this: ICustomWorld, selector: string) {
77+
await expect(this.page.locator(selector)).toBeVisible({ timeout: 15000 });
78+
});
79+
80+
7281
/**
7382
* Executes the step to assert the visibility of a banner in iframe with specific text.
7483
*/
@@ -156,7 +165,7 @@ When('I go {string}', async function (this: ICustomWorld, url: string) {
156165
*/
157166
When('I connect as {string}', async function (this: ICustomWorld, user: string) {
158167
await this.utils.wpAdminLogout();
159-
await this.utils.auth('admin2');
168+
await this.utils.auth(user);
160169
});
161170

162171
/**

0 commit comments

Comments
 (0)