Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix Sanity Test 1 image paths #5600

Merged
merged 3 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 55 additions & 56 deletions __device-tests__/gutenberg-editor-sanity-test-1-visual.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,63 +245,62 @@ describe( 'Gutenberg Editor - Test Suite 1', () => {
await isEditorVisible( editorPage.driver );
}
} );
} );

it( 'sliders display proportionate fill level previews', async () => {
await editorPage.addNewBlock( blockNames.columns );
// Wait for the modal to open
await editorPage.driver.sleep( 3000 );
await editorPage.dismissBottomSheet();
await editorPage.openBlockSettings();
// Wait for the modal to open
await editorPage.driver.sleep( 3000 );

const cellId = isAndroid()
? 'Column 1. Width is 50 Percent (%)., double-tap to change unit'
: 'Column 1. Width is 50 Percent (%).';
const cell = await editorPage.driver.elementByAccessibilityId( cellId );
const cellSize = await cell.getSize();
const cellLocation = await cell.getLocation();
const scrollOffset = isAndroid() ? 350 : 100;

// Reveal default column width cells
await swipeFromTo(
editorPage.driver,
{
x: cellLocation.x + cellSize.width / 2,
y: cellLocation.y + cellSize.height / 2,
},
{
x: cellLocation.x + cellSize.width / 2,
y: cellLocation.y + cellSize.height / 2 - scrollOffset,
},
1000
);
// Shrink the first column
await swipeFromTo(
editorPage.driver,
{
x: cellLocation.x + cellSize.width * 0.42,
y: cellLocation.y - scrollOffset + cellSize.height * 0.69,
},
{
x:
cellLocation.x +
cellSize.width * 0.42 -
cellSize.width * 0.15,
y: cellLocation.y - scrollOffset + cellSize.height * 0.69,
},
1000
);

// Visual test check for adjusted columns
const screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot( {
// Detect minute differences in column preview sizes
failureThreshold: 0, // 0%
} );
it( 'sliders display proportionate fill level previews', async () => {
await editorPage.addNewBlock( blockNames.columns );
// Wait for the modal to open
await editorPage.driver.sleep( 3000 );
await editorPage.dismissBottomSheet();
await editorPage.openBlockSettings();
// Wait for the modal to open
await editorPage.driver.sleep( 3000 );

await editorPage.dismissBottomSheet();
await editorPage.removeBlock();
const cellId = isAndroid()
? 'Column 1. Width is 50 Percent (%)., double-tap to change unit'
: 'Column 1. Width is 50 Percent (%).';
const cell = await editorPage.driver.elementByAccessibilityId(
cellId
);
const cellSize = await cell.getSize();
const cellLocation = await cell.getLocation();
const scrollOffset = isAndroid() ? 350 : 100;

// Reveal default column width cells
await swipeFromTo(
editorPage.driver,
{
x: cellLocation.x + cellSize.width / 2,
y: cellLocation.y + cellSize.height / 2,
},
{
x: cellLocation.x + cellSize.width / 2,
y: cellLocation.y + cellSize.height / 2 - scrollOffset,
},
1000
);
// Shrink the first column
await swipeFromTo(
editorPage.driver,
{
x: cellLocation.x + cellSize.width * 0.42,
y: cellLocation.y - scrollOffset + cellSize.height * 0.69,
},
{
x:
cellLocation.x +
cellSize.width * 0.42 -
cellSize.width * 0.15,
y: cellLocation.y - scrollOffset + cellSize.height * 0.69,
},
1000
);

// Visual test check for adjusted columns
const screenshot = await takeScreenshot();
expect( screenshot ).toMatchImageSnapshot();

await editorPage.dismissBottomSheet();
await editorPage.removeBlock();
} );
} );
} );
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.