Skip to content

Commit cf4dbec

Browse files
committed
another test fix attempt
1 parent 149c7f1 commit cf4dbec

2 files changed

Lines changed: 6 additions & 22 deletions

File tree

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,9 @@ class MwpMarketplaceSetupWizard {
5555
await $('.button=Activate Plugin').waitForDisplayed({ timeout: 30000 });
5656

5757
await $('.button=Activate Plugin').click();
58-
try {
59-
await browser.waitUntil(() => {
60-
return browser.execute(() => /page=matomo-marketplace/.test(window.location.pathname));
61-
}, {timeout: 30000});
62-
} catch (e) {
63-
console.log(await browser.execute(() => window.location.pathname));
64-
throw e;
65-
}
58+
await browser.waitUntil(() => {
59+
return browser.execute(() => /page=matomo-marketplace/.test(window.location.href));
60+
}, {timeout: 30000});
6661

6762
await browser.switchWindow(/page=matomo-marketplace/);
6863
}

tests/phpunit/wpmatomo/ecommerce/test-woocommerce.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function test_order_tracking_when_expected_user_flow() {
147147
$script_type = $this->get_type_attribute();
148148

149149
$expected_code = <<<EOF
150-
<script $script_type>$cdata_start
150+
<script$script_type>$cdata_start
151151
window._paq = window._paq || []; window._paq.push(["addEcommerceItem","10","a tiny hat",["Uncategorized"],12,2]);window._paq = window._paq || []; window._paq.push(["trackEcommerceCartUpdate","24.00"]);
152152
$cdata_end</script>
153153
EOF;
@@ -184,10 +184,10 @@ public function test_order_tracking_when_order_processed_before_order_received()
184184
$script_type = $this->get_type_attribute();
185185

186186
$expected_code = <<<EOF
187-
<script $script_type>$cdata_start
187+
<script$script_type>$cdata_start
188188
window._paq = window._paq || []; window._paq.push(["addEcommerceItem","10","a tiny hat",["Uncategorized"],12,2]);window._paq = window._paq || []; window._paq.push(["trackEcommerceCartUpdate","24.00"]);
189189
$cdata_end</script>
190-
<script $script_type>$cdata_start
190+
<script$script_type>$cdata_start
191191
window._paq = window._paq || []; window._paq.push(["addEcommerceItem","10","a tiny hat",["Uncategorized"],12,2]);window._paq = window._paq || []; window._paq.push(["trackEcommerceOrder","11","24.00",24,"0","0",0]);
192192
$cdata_end</script>
193193
EOF;
@@ -441,15 +441,4 @@ private function set_visitor_id_cookie( $visitor_id ) {
441441
$this->test_instance->setTracker( $this->tracker );
442442
$this->assertEquals( $visitor_id, $this->test_instance->getTracker()->forcedVisitorId );
443443
}
444-
445-
/**
446-
* @return string
447-
*/
448-
protected function get_type_attribute() {
449-
$type = '';
450-
if ( function_exists( 'wp_get_inline_script_tag' ) && ! is_admin() && ! current_theme_supports( 'html5', 'script' ) ) {
451-
$type = 'type="text/javascript"';
452-
}
453-
return $type;
454-
}
455444
}

0 commit comments

Comments
 (0)