Skip to content

Commit

Permalink
Fix 2.8.0 test issues for AWS (#992)
Browse files Browse the repository at this point in the history
* Fixed issue with 2024 theme selector targets. Added 2025 theme support with WP 6.7+.
  • Loading branch information
jacobd91 authored Nov 7, 2024
1 parent 01a91cf commit 03517c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 10 additions & 6 deletions qa/tests/generic/referrer-groups-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ if (parseFloat(env.wpVersion) < 4.4) {
otherTheme = 'twentytwenty/twentytwenty';
} else if (parseFloat(env.wpVersion) < 6.4) {
otherTheme = 'twentytwentythree/twentytwentythree';
} else {
// WP 6.4.
} else if (parseFloat(env.wpVersion) < 6.7) {
otherTheme = 'twentytwentyfour/twentytwentyfour';
} else {
// WP 6.7.
otherTheme = 'twentytwentyfive/twentytwentyfive';
}

log.log('Switch to theme: ' + otherTheme);
Expand Down Expand Up @@ -132,15 +134,17 @@ describe('', function() {
} else if (theme[0] == 'twentytwentythree') {
css = await page.$eval('#wp-webfonts-inline-css',
(e) => e.innerHTML);
} else if (theme[0] == 'twentytwentyfour') {
css = await page.$eval('#wp-fonts-local',
(e) => e.innerHTML);
} else if (['twentytwentyfour', 'twentytwentyfive'].includes(theme[0])) {
css = await page.$eval(
parseFloat(env.wpVersion) >= 6.7 ? '.wp-fonts-local': '#wp-fonts-local',
(e) => e.innerHTML
);
} else {
css = await page.$eval('link[type="text/css"]',
(e) => e.getAttribute('href'));
}

if (theme[0] == 'twentytwentythree' || theme[0] == 'twentytwentyfour') {
if (['twentytwentythree', 'twentytwentyfour', 'twentytwentyfive'].includes(theme[0])) {
expect(css).contains('themes/' + theme[0] + '/assets/');
} else {
expect(css).contains('themes/' + theme[0] + '/style.css');
Expand Down
16 changes: 10 additions & 6 deletions qa/tests/generic/user-agent-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ if (parseFloat(env.wpVersion) < 4.4) {
otherTheme = 'twentytwenty/twentytwenty';
} else if (parseFloat(env.wpVersion) < 6.4) {
otherTheme = 'twentytwentythree/twentytwentythree';
} else {
// WP 6.4.
} else if (parseFloat(env.wpVersion) < 6.7) {
otherTheme = 'twentytwentyfour/twentytwentyfour';
} else {
// WP 6.7.
otherTheme = 'twentytwentyfive/twentytwentyfive';
}

log.log('Switch to theme: ' + otherTheme);
Expand Down Expand Up @@ -133,15 +135,17 @@ describe('', function() {
} else if (theme[0] == 'twentytwentythree') {
css = await page.$eval('#wp-webfonts-inline-css',
(e) => e.innerHTML);
} else if (theme[0] == 'twentytwentyfour') {
css = await page.$eval('#wp-fonts-local',
(e) => e.innerHTML);
} else if (['twentytwentyfour', 'twentytwentyfive'].includes(theme[0])) {
css = await page.$eval(
parseFloat(env.wpVersion) >= 6.7 ? '.wp-fonts-local': '#wp-fonts-local',
(e) => e.innerHTML
);
} else {
css = await page.$eval('link[type="text/css"]',
(e) => e.getAttribute('href'));
}

if (theme[0] == 'twentytwentythree' || theme[0] == 'twentytwentyfour') {
if (['twentytwentythree', 'twentytwentyfour', 'twentytwentyfive'].includes(theme[0])) {
expect(css).contains('themes/' + theme[0] + '/assets/');
} else {
expect(css).contains('themes/' + theme[0] + '/style.css');
Expand Down

0 comments on commit 03517c2

Please sign in to comment.