Skip to content

Commit

Permalink
Merge pull request #6281 from wordpress-mobile/test/appium-update-uns…
Browse files Browse the repository at this point in the history
…upported-block

test: Update Unsupported Block tests for Appium 2
  • Loading branch information
dcalhoun authored Oct 16, 2023
2 parents 88f20ad + 32517d4 commit 266c613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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
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();
const { pixelRatio } = sessionCapabilities;
const pixelRatio = editorPage.driver.capabilities.pixelRatio;

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.pixelRatio;

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

0 comments on commit 266c613

Please sign in to comment.