-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5969 from wordpress-mobile/update-media-placehold…
…ers-and-block-outline Update media placeholders and block outline
- Loading branch information
Showing
44 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
__device-tests__/gutenberg-editor-unsupported-block-visual.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
const { isAndroid, toggleDarkMode, isEditorVisible } = e2eUtils; | ||
import { takeScreenshot } from './utils'; | ||
|
||
describe( 'Gutenberg Editor Visual test for Unsupported Block', () => { | ||
it( 'should show the empty placeholder for the selected/unselected state', async () => { | ||
await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml ); | ||
|
||
let unsupportedBlock = await editorPage.getBlockAtPosition( | ||
editorPage.blockNames.unsupported | ||
); | ||
await unsupportedBlock.click(); | ||
|
||
// Visual test check | ||
let screenshot = await takeScreenshot(); | ||
expect( screenshot ).toMatchImageSnapshot(); | ||
|
||
// Select title to unfocus the block | ||
const titleElement = await editorPage.getTitleElement(); | ||
await titleElement.click(); | ||
|
||
await editorPage.dismissKeyboard(); | ||
|
||
// Visual test check | ||
screenshot = await takeScreenshot(); | ||
expect( screenshot ).toMatchImageSnapshot(); | ||
|
||
unsupportedBlock = await editorPage.getBlockAtPosition( | ||
editorPage.blockNames.unsupported | ||
); | ||
await unsupportedBlock.click(); | ||
await editorPage.removeBlock(); | ||
} ); | ||
|
||
it( 'should show the empty placeholder for the selected/unselected state in dark mode', async () => { | ||
await toggleDarkMode( editorPage.driver, true ); | ||
|
||
// The Android editor requires a restart to apply dark mode | ||
if ( isAndroid() ) { | ||
await editorPage.driver.resetApp(); | ||
await isEditorVisible( editorPage.driver ); | ||
} | ||
|
||
await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml ); | ||
|
||
let unsupportedBlock = await editorPage.getBlockAtPosition( | ||
editorPage.blockNames.unsupported | ||
); | ||
await unsupportedBlock.click(); | ||
|
||
// Visual test check | ||
let screenshot = await takeScreenshot(); | ||
expect( screenshot ).toMatchImageSnapshot(); | ||
|
||
// Select title to unfocus the block | ||
const titleElement = await editorPage.getTitleElement(); | ||
await titleElement.click(); | ||
|
||
await editorPage.dismissKeyboard(); | ||
|
||
// Visual test check | ||
screenshot = await takeScreenshot(); | ||
expect( screenshot ).toMatchImageSnapshot(); | ||
|
||
unsupportedBlock = await editorPage.getBlockAtPosition( | ||
editorPage.blockNames.unsupported | ||
); | ||
await unsupportedBlock.click(); | ||
await editorPage.removeBlock(); | ||
|
||
await toggleDarkMode( editorPage.driver, false ); | ||
|
||
// The Android editor requires a restart to apply dark mode | ||
if ( isAndroid() ) { | ||
await editorPage.driver.resetApp(); | ||
await isEditorVisible( editorPage.driver ); | ||
} | ||
} ); | ||
|
||
it( 'should be able to open the unsupported block web view editor', async () => { | ||
await editorPage.setHtmlContent( e2eTestData.unsupportedBlockHtml ); | ||
|
||
const unsupportedBlock = await editorPage.getBlockAtPosition( | ||
editorPage.blockNames.unsupported | ||
); | ||
await unsupportedBlock.click(); | ||
|
||
const helpButton = await editorPage.getUnsupportedBlockHelpButton(); | ||
await helpButton.click(); | ||
|
||
// Wait for the modal to show | ||
await editorPage.driver.sleep( 3000 ); | ||
|
||
// Visual test check | ||
const screenshot = await takeScreenshot(); | ||
expect( screenshot ).toMatchImageSnapshot(); | ||
|
||
// Disabled for now on Android see https://github.com/wordpress-mobile/gutenberg-mobile/issues/5321 | ||
if ( ! isAndroid() ) { | ||
const editButton = await editorPage.getUnsupportedBlockBottomSheetEditButton(); | ||
await editButton.click(); | ||
|
||
const webView = await editorPage.getUnsupportedBlockWebView(); | ||
await expect( webView ).toBeTruthy(); | ||
} | ||
} ); | ||
} ); |
Binary file modified
BIN
+20 Bytes
(100%)
...l-test-for-gallery-block-should-be-able-to-render-a-gallery-correctly-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+365 Bytes
(100%)
...-gallery-block-should-be-able-to-render-the-placeholder-correctly-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.08 KB
(94%)
...-for-gallery-block-should-be-able-to-render-the-placeholder-correctly-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(100%)
...roup-block-should-show-the-empty-placeholder-for-the-unselected-state-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-13 Bytes
(100%)
...r-test-suite-1-columns-block-allows-deep-nesting-to-at-least-3-levels-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+599 Bytes
(100%)
...s-block-displays-correctly-in-portrait-and-landscape-orientations-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(100%)
...lumns-block-displays-correctly-in-portrait-and-landscape-orientations-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+407 Bytes
(100%)
...s-block-displays-correctly-in-portrait-and-landscape-orientations-2-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+626 Bytes
(100%)
...lumns-block-displays-correctly-in-portrait-and-landscape-orientations-2-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+213 Bytes
(100%)
...-test-suite-1-columns-block-displays-placeholders-when-unselected-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
...itor-test-suite-1-columns-block-displays-placeholders-when-unselected-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+253 Bytes
(100%)
...-test-suite-1-columns-block-displays-placeholders-when-unselected-2-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+125 Bytes
(100%)
...itor-test-suite-1-columns-block-displays-placeholders-when-unselected-2-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+554 Bytes
(100%)
...columns-block-displays-with-correct-colors-with-dark-mode-enabled-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+631 Bytes
(100%)
...e-1-columns-block-displays-with-correct-colors-with-dark-mode-enabled-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+266 Bytes
(100%)
...columns-block-displays-with-correct-colors-with-dark-mode-enabled-2-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+621 Bytes
(100%)
...e-1-columns-block-displays-with-correct-colors-with-dark-mode-enabled-2-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+271 Bytes
(100%)
...te-1-columns-block-mover-buttons-display-in-the-correct-positions-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+685 Bytes
(100%)
...-suite-1-columns-block-mover-buttons-display-in-the-correct-positions-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+188 Bytes
(100%)
...te-1-columns-block-mover-buttons-display-in-the-correct-positions-2-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+701 Bytes
(100%)
...-suite-1-columns-block-mover-buttons-display-in-the-correct-positions-2-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+186 Bytes
(100%)
...1-columns-block-sliders-display-proportionate-fill-level-previews-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1.54 KB
(100%)
...ite-1-columns-block-sliders-display-proportionate-fill-level-previews-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-145 Bytes
(99%)
...4-buttons-block-check-if-selection-caret-color-matches-font-color-1-android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-57 Bytes
(100%)
...ite-4-buttons-block-check-if-selection-caret-color-matches-font-color-1-ios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-24 Bytes
(100%)
...-test-js-gutenberg-editor-test-suite-4-buttons-block-edit-text-styles-1-ios.png
Oops, something went wrong.
Binary file modified
BIN
-5 Bytes
(100%)
...or-test-suite-4-buttons-block-render-custom-text-and-background-color-1-ios.png
Oops, something went wrong.
Binary file modified
BIN
-7 Bytes
(100%)
...rg-editor-test-suite-4-buttons-block-render-gradient-background-color-1-ios.png
Oops, something went wrong.
Binary file modified
BIN
+186 Bytes
(100%)
...uite-4-spacer-block-spacer-in-horizontal-layout-works-as-expected-1-android.png
Oops, something went wrong.
Binary file modified
BIN
+362 Bytes
(100%)
...st-suite-4-spacer-block-spacer-in-horizontal-layout-works-as-expected-1-ios.png
Oops, something went wrong.
Binary file added
BIN
+29.2 KB
...lock-should-be-able-to-open-the-unsupported-block-web-view-editor-1-android.png
Oops, something went wrong.
Binary file added
BIN
+42.4 KB
...ed-block-should-be-able-to-open-the-unsupported-block-web-view-editor-1-ios.png
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
...ould-show-the-empty-placeholder-for-the-selected-unselected-state-1-android.png
Oops, something went wrong.
Binary file added
BIN
+17.3 KB
...k-should-show-the-empty-placeholder-for-the-selected-unselected-state-1-ios.png
Oops, something went wrong.
Binary file added
BIN
+14.7 KB
...ould-show-the-empty-placeholder-for-the-selected-unselected-state-2-android.png
Oops, something went wrong.
Binary file added
BIN
+18.5 KB
...k-should-show-the-empty-placeholder-for-the-selected-unselected-state-2-ios.png
Oops, something went wrong.
Binary file added
BIN
+13.7 KB
...-empty-placeholder-for-the-selected-unselected-state-in-dark-mode-1-android.png
Oops, something went wrong.
Binary file added
BIN
+17.2 KB
...-the-empty-placeholder-for-the-selected-unselected-state-in-dark-mode-1-ios.png
Oops, something went wrong.
Binary file added
BIN
+14.8 KB
...-empty-placeholder-for-the-selected-unselected-state-in-dark-mode-2-android.png
Oops, something went wrong.
Binary file added
BIN
+17.9 KB
...-the-empty-placeholder-for-the-selected-unselected-state-in-dark-mode-2-ios.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters