Skip to content

Commit b15eefe

Browse files
committed
other test fixes
1 parent ab03cae commit b15eefe

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

Lines changed: 2 additions & 2 deletions
Loading

tests/e2e/mwp-admin.summary.e2e.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ describe('MWP Admin > Summary', () => {
3030
).toBeLessThan(0.01);
3131
});
3232

33+
it('should pin reports to the WordPress dashboard when the pin icon is clicked', async () => {
34+
await MwpSummaryPage.pinReport(0);
35+
36+
await browser.url(`${await Website.baseUrl()}/wp-admin/index.php`);
37+
await $('#matomo_dashboard_widget_visits_over_time_thismonth').waitForDisplayed();
38+
});
39+
3340
it('should change the date correctly when a period button is toggled', async () => {
3441
await MwpSummaryPage.changePeriod('This month');
3542

@@ -44,11 +51,4 @@ describe('MWP Admin > Summary', () => {
4451
await browser.checkFullPageScreen(`mwp-admin.summary.thismonth.${process.env.PHP_VERSION}${trunkSuffix}`)
4552
).toBeLessThan(5.0);
4653
});
47-
48-
it('should pin reports to the WordPress dashboard when the pin icon is clicked', async () => {
49-
await MwpSummaryPage.pinReport(0);
50-
51-
await browser.url(`${await Website.baseUrl()}/wp-admin/index.php`);
52-
await $('#matomo_dashboard_widget_visits_over_time_thismonth').waitForDisplayed();
53-
});
5454
});

tests/e2e/pageobjects/blog-product.page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class BlogProductPage extends Page {
3232

3333
await browser.waitUntil(async () => {
3434
return browser.execute(() => {
35-
return window.jQuery && window.jQuery('a:contains("View cart"):visible').length > 0;
35+
return window.jQuery && window.jQuery('.woocommerce-message a:contains("View cart"):visible').length > 0;
3636
});
3737
});
3838

3939
await Website.retry(3, async () => {
4040
let cp = await browser.execute(() => {
41-
return window.jQuery ? window.jQuery('a:contains("View cart"):visible').attr('href') : null;
41+
return window.jQuery ? window.jQuery('.woocommerce-message a:contains("View cart"):visible').attr('href') : null;
4242
});
4343

4444
if (!cp) {
@@ -49,7 +49,7 @@ class BlogProductPage extends Page {
4949
}, 500);
5050

5151
await browser.execute(() => {
52-
window.jQuery('a:contains("View cart"):visible')[0].click();
52+
window.jQuery('.woocommerce-message a:contains("View cart"):visible')[0].click();
5353
});
5454

5555
try {

tests/e2e/pageobjects/mwp-admin/summary.page.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class MwpSummaryPage extends MwpPage {
2929
}
3030

3131
async pinReport(index: number) {
32-
const boxes = await $$('.postbox');
33-
const pin = await boxes[index].$('button.handlediv');
34-
await pin.click();
32+
await browser.execute((i) => {
33+
window.jQuery('.postbox button.handlediv')[i].click();
34+
}, index);
3535

3636
await browser.waitUntil(async () => {
3737
return await browser.execute(async () => window.jQuery('.notice.notice-success:contains(Dashboard updated.)').length);

0 commit comments

Comments
 (0)