Skip to content

Commit

Permalink
Merge pull request #1788 from wordpress-mobile/release/1.21.0
Browse files Browse the repository at this point in the history
Release v1.21.0
  • Loading branch information
etoledom committed Jan 23, 2020
2 parents d2d97a8 + 259d4c7 commit beff3d2
Show file tree
Hide file tree
Showing 33 changed files with 2,336 additions and 1,979 deletions.
6 changes: 6 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
1.21.0
------
* Reduced padding around text on Rich Text based blocks.
* [Android] Improved stability on very long posts.

1.20.0
------
* Fix bug where image placeholders would sometimes not be shown
* Fix crash on undo
* Style fixes on the navigation UI
* [iOS] Fix focus issue
* New block: Shortcode. You can now create and edit Shortcode blocks in the editor.

1.19.0
------
Expand Down
56 changes: 56 additions & 0 deletions __device-tests__/gutenberg-editor-gallery.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* @format
* */

/**
* Internal dependencies
*/
import EditorPage from './pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver,
} from './helpers/utils';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000000;

describe( 'Gutenberg Editor Gallery Block tests', () => {
let driver;
let editorPage;
let allPassed = true;

// Use reporter for setting status for saucelabs Job
if ( ! isLocalEnvironment() ) {
const reporter = {
specDone: async ( result ) => {
allPassed = allPassed && result.status !== 'failed';
},
};

jasmine.getEnv().addReporter( reporter );
}

beforeAll( async () => {
driver = await setupDriver();
editorPage = new EditorPage( driver );
} );

it( 'should be able to see visual editor', async () => {
await expect( editorPage.getBlockList() ).resolves.toBe( true );
} );

it( 'should be able to add a gallery block', async () => {
await editorPage.addNewGalleryBlock();
const galleryBlock = await editorPage.getGalleryBlockAtPosition( 1 );

expect( galleryBlock ).toBeTruthy();
await editorPage.removeGalleryBlockAtPosition( 1 );
} );

afterAll( async () => {
if ( ! isLocalEnvironment() ) {
driver.sauceJobStatus( allPassed );
}
await stopDriver( driver );
} );
} );
29 changes: 21 additions & 8 deletions __device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class EditorPage {
listBlockName = 'List';
headingBlockName = 'Heading';
imageBlockName = 'Image';
galleryBlockName = 'Gallery';

// This is needed to adapt to changes in the way accessibility ids are being
// assigned after migrating to AndroidX and React Native 0.60. See:
Expand Down Expand Up @@ -47,7 +48,7 @@ export default class EditorPage {
// and accessibilityId attributes on this object and selects the block
// position uses one based numbering
async getBlockAtPosition( position: number, blockName: string, options: { autoscroll: boolean } = { autoscroll: false } ) {
const blockLocator = `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ blockName } Block. Row ${ position }.")]`;
const blockLocator = `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ blockName } Block. Row ${ position }")]`;
const elements = await this.driver.elementsByXPath( blockLocator );
const lastElementFound = elements[ elements.length - 1 ];
if ( elements.length === 0 && options.autoscroll ) {
Expand Down Expand Up @@ -211,14 +212,11 @@ export default class EditorPage {
throw Error( `No Block at position ${ position }` );
}

const parentId = `${ blockName } Block. Row ${ position }.`;
const parentLocator = `//*[contains(@${ this.accessibilityIdXPathAttrib }, "${ parentId }")]`;
let removeBlockLocator = `${ parentLocator }`;
removeBlockLocator += isAndroid() ? '//*' : '//XCUIElementTypeButton';
let removeButtonIdentifier = `Remove block at row ${ position }`;
const buttonElementName = isAndroid() ? '//*' : '//XCUIElementTypeButton';
const removeButtonIdentifier = `Remove block at row ${ position }`;
const removeBlockLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ removeButtonIdentifier }")]`;

if ( isAndroid() ) {
removeButtonIdentifier += `, Double tap to remove the block${ this.accessibilityIdSuffix }`;
const block = await this.getBlockAtPosition( position, blockName );
let checkList = await this.driver.elementsByXPath( removeBlockLocator );
while ( checkList.length === 0 ) {
Expand All @@ -227,7 +225,6 @@ export default class EditorPage {
}
}

removeBlockLocator += `[@${ this.accessibilityIdXPathAttrib }="${ removeButtonIdentifier }"]`;
const removeButton = await this.driver.elementByXPath( removeBlockLocator );
await removeButton.click();
}
Expand Down Expand Up @@ -381,6 +378,22 @@ export default class EditorPage {
return await this.removeBlockAtPosition( position, this.imageBlockName );
}

// =========================
// Gallery Block functions
// =========================

async addNewGalleryBlock() {
await this.addNewBlock( this.galleryBlockName );
}

async getGalleryBlockAtPosition( position: number ) {
return this.getBlockAtPosition( position, this.galleryBlockName );
}

async removeGalleryBlockAtPosition( position: number ) {
return await this.removeBlockAtPosition( position, this.galleryBlockName );
}

// =========================
// Heading Block functions
// =========================
Expand Down
1,905 changes: 955 additions & 950 deletions bundle/android/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/App.js.map

Large diffs are not rendered by default.

14 changes: 6 additions & 8 deletions bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- translators: accessibility text. Inform about current value. %1$s: Control label %2$s: Current value. -->
<string name="gutenberg_native_1_s_current_value_is_2_s" tools:ignore="UnusedResources">%1$s. Current value is %2$s</string>
<string name="gutenberg_native_add_a_description" tools:ignore="UnusedResources">Add a description</string>
<string name="gutenberg_native_add_a_shortcode" tools:ignore="UnusedResources">Add a shortcode…</string>
<string name="gutenberg_native_add_annotation" tools:ignore="UnusedResources">Add annotation</string>
<string name="gutenberg_native_add_block_here" tools:ignore="UnusedResources">ADD BLOCK HERE</string>
<string name="gutenberg_native_add_image" tools:ignore="UnusedResources">ADD IMAGE</string>
Expand Down Expand Up @@ -30,10 +31,12 @@
<string name="gutenberg_native_double_tap_to_select" tools:ignore="UnusedResources">Double tap to select</string>
<string name="gutenberg_native_double_tap_to_select_a_video" tools:ignore="UnusedResources">Double tap to select a video</string>
<string name="gutenberg_native_double_tap_to_select_an_image" tools:ignore="UnusedResources">Double tap to select an image</string>
<string name="gutenberg_native_double_tap_to_select_layout" tools:ignore="UnusedResources">Double tap to select layout</string>
<!-- translators: accessibility text (hint for switches) -->
<string name="gutenberg_native_double_tap_to_toggle_setting" tools:ignore="UnusedResources">Double tap to toggle setting</string>
<string name="gutenberg_native_double_tap_to_undo_last_change" tools:ignore="UnusedResources">Double tap to undo last change</string>
<string name="gutenberg_native_empty" tools:ignore="UnusedResources">Empty</string>
<string name="gutenberg_native_edit_media" tools:ignore="UnusedResources">Edit media</string>
<string name="gutenberg_native_edit_video" tools:ignore="UnusedResources">Edit video</string>
<string name="gutenberg_native_failed_to_insert_media_please_tap_for_options" tools:ignore="UnusedResources">Failed to insert media.\nPlease tap for options.</string>
<!-- translators: accessibility text. %s: gallery caption. -->
<string name="gutenberg_native_gallery_caption_s" tools:ignore="UnusedResources">Gallery caption. %s</string>
Expand All @@ -42,10 +45,6 @@
<string name="gutenberg_native_hide_keyboard" tools:ignore="UnusedResources">Hide keyboard</string>
<!-- translators: accessibility text. %s: image caption. -->
<string name="gutenberg_native_image_caption_s" tools:ignore="UnusedResources">Image caption. %s</string>
<!-- translators: accessibility text. 1: heading level. 2: heading content. -->
<string name="gutenberg_native_level_1_s_2_s" tools:ignore="UnusedResources">Level %1$s. %2$s</string>
<!-- translators: accessibility text. %s: heading level. -->
<string name="gutenberg_native_level_s_empty" tools:ignore="UnusedResources">Level %s. Empty.</string>
<string name="gutenberg_native_link_inserted" tools:ignore="UnusedResources">Link inserted</string>
<string name="gutenberg_native_link_text" tools:ignore="UnusedResources">Link text</string>
<string name="gutenberg_native_move_block_down" tools:ignore="UnusedResources">Move block down</string>
Expand Down Expand Up @@ -77,9 +76,6 @@
<string name="gutenberg_native_remove_block_at_row_s" tools:ignore="UnusedResources">Remove block at row %s</string>
<string name="gutenberg_native_remove_image" tools:ignore="UnusedResources">Remove Image</string>
<string name="gutenberg_native_reset_block" tools:ignore="UnusedResources">Reset Block</string>
<string name="gutenberg_native_row_d" tools:ignore="UnusedResources">Row %d.</string>
<!-- translators: accessibility text. %s: block name. -->
<string name="gutenberg_native_s_block" tools:ignore="UnusedResources">%s Block</string>
<!-- translators: accessibility text for the media block empty state. %s: media type -->
<string name="gutenberg_native_s_block_empty" tools:ignore="UnusedResources">%s block. Empty</string>
<!-- translators: accessibility text for blocks with invalid content. %d: localized block title -->
Expand All @@ -100,6 +96,8 @@
<string name="gutenberg_native_title" tools:ignore="UnusedResources">Title:</string>
<string name="gutenberg_native_translate" tools:ignore="UnusedResources">Translate</string>
<string name="gutenberg_native_ungroup" tools:ignore="UnusedResources">Ungroup</string>
<!-- translators: accessibility text. %s: video caption. -->
<string name="gutenberg_native_video_caption_s" tools:ignore="UnusedResources">Video caption. %s</string>
<string name="gutenberg_native_we_are_working_hard_to_add_more_blocks_with_each_release_in_the_m" tools:ignore="UnusedResources">We are working hard to add more blocks with each release. In the meantime, you can also edit this post on the web.</string>
<string name="gutenberg_native_wordpress_media_library" tools:ignore="UnusedResources">WordPress Media Library</string>
</resources>
Loading

0 comments on commit beff3d2

Please sign in to comment.