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: Update Unsupported Block tests for Appium 2 #6281

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe( 'Gutenberg Editor Visual test for Unsupported Block', () => {
);
await unsupportedBlock.click();
// Wait for the block to be selected
await editorPage.driver.sleep( 500 );
await editorPage.driver.pause( 500 );

// Visual test check
let screenshot = await takeScreenshot();
Expand Down Expand Up @@ -43,6 +43,8 @@ describe( 'Gutenberg Editor Visual test for Unsupported Block', () => {
editorPage.blockNames.unsupported
);
await unsupportedBlock.click();
// Wait for the block to be selected
await editorPage.driver.pause( 1000 );

// Visual test check
let screenshot = await takeScreenshot();
Expand Down Expand Up @@ -75,7 +77,7 @@ describe( 'Gutenberg Editor Visual test for Unsupported Block', () => {
await helpButton.click();

// Wait for the modal to show
await editorPage.driver.sleep( 3000 );
await editorPage.driver.pause( 3000 );

// Visual test check
const screenshot = await takeScreenshot();
Expand Down
dcalhoun marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions __device-tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ const SUPPORTED_GLOBAL_STYLES_ELEMENTS = [
* @return {Buffer} Sreenshot image.
*/
export async function takeScreenshotByElement( element, { padding } = {} ) {
const sessionCapabilities = await editorPage.driver.sessionCapabilities();
geriux marked this conversation as resolved.
Show resolved Hide resolved
const { pixelRatio } = sessionCapabilities;
const pixelRatio = editorPage.driver.capabilities.devicePixelRatio;

const location = await element.getLocation();
const size = await element.getSize();
Expand Down Expand Up @@ -110,8 +109,7 @@ export async function takeScreenshotByElement( element, { padding } = {} ) {
*/
export async function takeScreenshot( { withoutKeyboard, crop } = {} ) {
const iPadDevice = process.env.IPAD;
const sessionCapabilities = await editorPage.driver.sessionCapabilities();
const { pixelRatio } = sessionCapabilities;
const pixelRatio = editorPage.driver.capabilities.devicePixelRatio;

const orientation = await editorPage.driver.getOrientation();
const isPortrait = orientation === 'PORTRAIT';
Expand Down