Skip to content

Commit

Permalink
MWPW-147299 (#368)
Browse files Browse the repository at this point in the history
* MWPW-147299

* MWPW-147299
  • Loading branch information
Blainegunn authored Jun 11, 2024
1 parent 26d6bf4 commit 9d92780
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
22 changes: 11 additions & 11 deletions selectors/milo/howto.block.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ export default class HowTo {
this.howToLarge = this.page.locator('.how-to.large-image').nth(nth);
this.howToSeo = this.page.locator('.how-to.seo').nth(nth);
this.heading = this.howTo.locator('.how-to-heading');
this.image = this.howTo.locator('.how-to-image');
this.image = this.howTo.locator('.how-to-media');
this.list = this.howTo.locator('li');
this.largeImage = page.locator('.how-to-image img');
this.largeImage = page.locator('.how-to-media img');

// howto contents css
this.cssProperties = {
'.how-to .foreground': {
'padding': '80px 0px',
padding: '80px 0px',
'max-width': /%$/,
'display': 'grid',
display: 'grid',
},
'how-to-image': {
'how-to-media': {
'align-self': 'center',
'justify-self': 'center',
'min-height': '100%',
Expand All @@ -28,25 +28,25 @@ export default class HowTo {
'line-height': '27px',
},
'how-to-large': {
'padding': '80px 24px',
padding: '80px 24px',
'max-width': '700px',
},
'how-to-large-image': {
'display': 'block',
display: 'block',
'grid-template-areas': 'none',
},
'how-to-seo': {
'display': 'block',
display: 'block',
'grid-template-areas': 'none',
},
};

// howto contents attributes
this.attProperties = {
'how-to-large-image': {
'width': '600',
'height': '300',
width: '600',
height: '300',
},
};
}
};
}
9 changes: 5 additions & 4 deletions tests/milo/howto.block.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('Milo HowTo block test suite', () => {
howTo = new HowToBlock(page);
});

// Test 0 : HowTo default block
// Test 0 : HowTo default block
test(`${features[0].name},${features[0].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[0].path}${miloLibs}`);

Expand All @@ -30,11 +30,11 @@ test.describe('Milo HowTo block test suite', () => {

expect(await webUtil.verifyCSS_(howTo.foreground, howTo.cssProperties['.how-to .foreground'])).toBeTruthy();
expect(await webUtil.verifyCSS_(howTo.heading, howTo.cssProperties['body-m'])).toBeTruthy();
expect(await webUtil.verifyCSS_(howTo.image, howTo.cssProperties['how-to-image'])).toBeTruthy();
expect(await webUtil.verifyCSS_(howTo.image, howTo.cssProperties['how-to-media'])).toBeTruthy();
});
});

// Test 1 : how-to (large) block
// Test 1 : how-to (large) block
test(`${features[1].name},${features[1].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[1].path}${miloLibs}`);

Expand All @@ -50,11 +50,12 @@ test.describe('Milo HowTo block test suite', () => {

expect(await webUtil.verifyCSS_(howTo.heading, howTo.cssProperties['body-m'])).toBeTruthy();
expect(await webUtil.verifyCSS_(howTo.howToLarge, howTo.cssProperties['how-to-large-image'])).toBeTruthy();
// eslint-disable-next-line max-len
expect(await webUtil.verifyAttributes_(await howTo.largeImage, howTo.attProperties['how-to-large-image'])).toBeTruthy();
});
});

// Test 2 : how-to (seo) block
// Test 2 : how-to (seo) block
test(`${features[2].name},${features[2].tags}`, async ({ page, baseURL }) => {
console.info(`[Test Page]: ${baseURL}${features[2].path}${miloLibs}`);

Expand Down

0 comments on commit 9d92780

Please sign in to comment.