Skip to content

Commit a8b9cf8

Browse files
committed
try to fix e2e tests
1 parent 5eae457 commit a8b9cf8

3 files changed

Lines changed: 19 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,20 @@ describe('MWP Admin > Marketplace', () => {
7676

7777
// TODO: see if this still applies
7878
const pathToPlugin = await MwpMarketplacePage.setupWizard.downloadPlugin();
79+
console.log('install 1');
7980
await MwpMarketplacePage.setupWizard.goToPluginsAdmin();
81+
console.log('install 2');
8082
await MwpMarketplacePage.setupWizard.uploadPluginAndActivate(pathToPlugin);
83+
console.log('install 3');
8184
await MwpMarketplacePage.setupWizard.waitForReload();
85+
console.log('install 4');
8286

8387
await MwpMarketplacePage.sortPluginsAlphabetically();
88+
console.log('install 5');
8489
await MwpMarketplacePage.removeThirdPartyPlugins();
90+
console.log('install 6');
8591
await MwpMarketplacePage.prepareWpAdminForScreenshot();
92+
console.log('install 7');
8693
await expect(
8794
await browser.checkFullPageScreen(`mwp-admin.marketplace.setup-wizard-finished.${process.env.PHP_VERSION}${trunkSuffix}`)
8895
).toEqual(0);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class MwpMarketplaceSetupWizard {
5959
return browser.execute(() => /\/wp-admin\/plugins\.php$/.test(window.location.pathname));
6060
});
6161

62-
await browser.closeWindow();
6362
await browser.switchWindow(/page=matomo-marketplace/);
6463
}
6564

tests/phpunit/framework/test-case.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,25 @@ private function delete_extraneous_blogs() {
116116
* @return string
117117
*/
118118
protected function get_type_attribute() {
119-
$type = '';
120119
if (
121120
function_exists( 'wp_get_inline_script_tag' )
122121
&& ! is_admin()
123122
&& ! current_theme_supports( 'html5', 'script' )
124123
&& getenv( 'WORDPRESS_VERSION' ) !== 'trunk'
125124
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '6.4', '<' )
126125
) {
127-
$type = ' type="text/javascript"';
126+
return ' type="text/javascript"';
128127
}
129-
return $type;
128+
129+
if (
130+
getenv( 'WORDPRESS_VERSION' ) !== 'trunk'
131+
&& getenv( 'WORDPRESS_VERSION' ) !== 'latest'
132+
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '5.2', '<=' )
133+
) {
134+
return ' '; // in these versions, there is a space before the end of the tag, ie, '<script >'
135+
}
136+
137+
return '';
130138
}
131139

132140
private function snapshot_db_data() {
@@ -306,9 +314,6 @@ public function execute_scheduled_event( $event_name, $execute_all = false ) {
306314

307315
protected function is_wordpress_not_using_cdata_tags() {
308316
return getenv( 'WORDPRESS_VERSION' )
309-
&& (
310-
getenv( 'WORDPRESS_VERSION' ) !== 'latest'
311-
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '6.4', '<' )
312-
);
317+
&& version_compare( getenv( 'WORDPRESS_VERSION' ), '6.4', '<' );
313318
}
314319
}

0 commit comments

Comments
 (0)