Skip to content

Commit

Permalink
Merge pull request #1116 from wordpress-mobile/release/1.7.0
Browse files Browse the repository at this point in the history
Release/1.7.0
  • Loading branch information
hypest authored Jun 14, 2019
2 parents c413919 + 2840519 commit 300274c
Show file tree
Hide file tree
Showing 43 changed files with 1,874 additions and 2,230 deletions.
6 changes: 5 additions & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
1.7.0
------
* Fixed keyboard flickering issue after pressing Enter repeatedly on the Post Title.
* New blocks are available: video/quote/more

1.6.0
------
* Fixed issue with link settings where “Open in New Tab” was always OFF on open.
- A new block is available: video block.
* Added UI to display a warning when a block has invalid content.
19 changes: 15 additions & 4 deletions __device-tests__/gutenberg-editor-lists-end.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import EditorPage from './pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver } from './helpers/utils';
stopDriver,
isAndroid,
} from './helpers/utils';
import testData from './helpers/test-data';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 240000;

describe( 'Gutenberg Editor tests', () => {
describe( 'Gutenberg Editor tests for List block (end)', () => {
let driver;
let editorPage;
let allPassed = true;
Expand All @@ -35,18 +37,27 @@ describe( 'Gutenberg Editor tests', () => {
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 end a List block', async () => {
await editorPage.addNewListBlock();
const listBlockElement = await editorPage.getListBlockAtPosition( 1 );

// Click List block on Android to force EditText focus
if ( isAndroid() ) {
await listBlockElement.click();
}

// Send the first list item text
await editorPage.sendTextToListBlock( listBlockElement, testData.listItem1 );

// send an Enter
await editorPage.sendTextToParagraphBlock( listBlockElement, '\n' );
await editorPage.sendTextToListBlock( listBlockElement, '\n' );

// send an Enter
await editorPage.sendTextToParagraphBlock( listBlockElement, '\n' );
await editorPage.sendTextToListBlock( listBlockElement, '\n' );

await editorPage.verifyHtmlContent( testData.listEndedHtml );
} );
Expand Down
13 changes: 10 additions & 3 deletions __device-tests__/gutenberg-editor-lists.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ import EditorPage from './pages/editor-page';
import {
setupDriver,
isLocalEnvironment,
stopDriver } from './helpers/utils';
stopDriver,
isAndroid,
} from './helpers/utils';
import testData from './helpers/test-data';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 240000;

describe( 'Gutenberg Editor tests', () => {
describe( 'Gutenberg Editor tests for List block', () => {
let driver;
let editorPage;
let allPassed = true;
Expand Down Expand Up @@ -43,11 +45,16 @@ describe( 'Gutenberg Editor tests', () => {
await editorPage.addNewListBlock();
const listBlockElement = await editorPage.getListBlockAtPosition( 1 );

// Click List block on Android to force EditText focus
if ( isAndroid() ) {
await listBlockElement.click();
}

// Send the first list item text
await editorPage.sendTextToListBlock( listBlockElement, testData.listItem1 );

// send an Enter
await editorPage.sendTextToParagraphBlock( listBlockElement, '\n' );
await editorPage.sendTextToListBlock( listBlockElement, '\n' );

// Send the second list item text
await editorPage.sendTextToListBlock( listBlockElement, testData.listItem2 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import {
isLocalEnvironment,
clickMiddleOfElement,
clickBeginningOfElement,
stopDriver } from './helpers/utils';
stopDriver,
isAndroid,
} from './helpers/utils';
import testData from './helpers/test-data';

jasmine.DEFAULT_TIMEOUT_INTERVAL = 240000;

describe( 'Gutenberg Editor tests', () => {
describe( 'Gutenberg Editor tests for Paragraph Block', () => {
let driver;
let editorPage;
let allPassed = true;
Expand Down Expand Up @@ -44,13 +46,19 @@ describe( 'Gutenberg Editor tests', () => {
it( 'should be able to add a new Paragraph block', async () => {
await editorPage.addNewParagraphBlock();
const paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 );
if ( isAndroid() ) {
await paragraphBlockElement.click();
}
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, testData.shortText );
await editorPage.removeParagraphBlockAtPosition( 1 );
} );

it( 'should be able to split one paragraph block into two', async () => {
await editorPage.addNewParagraphBlock();
const paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 );
if ( isAndroid() ) {
await paragraphBlockElement.click();
}
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, testData.shortText );
const textViewElement = await editorPage.getTextViewForParagraphBlock( paragraphBlockElement );
await clickMiddleOfElement( driver, textViewElement );
Expand All @@ -71,6 +79,9 @@ describe( 'Gutenberg Editor tests', () => {
it( 'should be able to merge 2 paragraph blocks into 1', async () => {
await editorPage.addNewParagraphBlock();
let paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 );
if ( isAndroid() ) {
await paragraphBlockElement.click();
}
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, testData.shortText );
let textViewElement = await editorPage.getTextViewForParagraphBlock( paragraphBlockElement );
await clickMiddleOfElement( driver, textViewElement );
Expand All @@ -81,6 +92,9 @@ describe( 'Gutenberg Editor tests', () => {
const text0 = await editorPage.getTextForParagraphBlockAtPosition( 1 );
const text1 = await editorPage.getTextForParagraphBlockAtPosition( 2 );
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 2 );
if ( isAndroid() ) {
await paragraphBlockElement.click();
}
textViewElement = await editorPage.getTextViewForParagraphBlock( paragraphBlockElement );
await clickBeginningOfElement( driver, textViewElement );
await editorPage.sendTextToParagraphBlock( paragraphBlockElement, '\u0008' );
Expand All @@ -94,6 +108,10 @@ describe( 'Gutenberg Editor tests', () => {

it( 'should be able to create a post with multiple paragraph blocks', async () => {
await editorPage.addNewParagraphBlock();
const paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 );
if ( isAndroid() ) {
await paragraphBlockElement.click();
}
await editorPage.sendTextToParagraphBlockAtPosition( 1, testData.longText );

for ( let i = 4; i > 0; i-- ) {
Expand Down
20 changes: 13 additions & 7 deletions __device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import childProcess from 'child_process';
import wd from 'wd';
import crypto from 'crypto';
import path from 'path';

/**
* Internal dependencies
Expand Down Expand Up @@ -72,7 +73,7 @@ const setupDriver = async () => {
if ( isAndroid() ) {
desiredCaps = _.clone( android8 );
if ( isLocalEnvironment() ) {
desiredCaps.app = localAndroidAppPath;
desiredCaps.app = path.resolve( localAndroidAppPath );
try {
const androidVersion = childProcess
.execSync( 'adb shell getprop ro.build.version.release' )
Expand All @@ -92,7 +93,7 @@ const setupDriver = async () => {
} else {
desiredCaps = _.clone( ios12 );
if ( isLocalEnvironment() ) {
desiredCaps.app = localIOSAppPath;
desiredCaps.app = path.resolve( localIOSAppPath );
} else {
desiredCaps.app = 'sauce-storage:Gutenberg.app.zip'; // App should be preloaded to sauce storage, this can also be a URL
}
Expand Down Expand Up @@ -137,9 +138,6 @@ const stopDriver = async ( driver: wd.PromiseChainWebdriver ) => {
}
};

// attempts to type a string to a given element, need for this stems from
// https://github.com/appium/appium/issues/12285#issuecomment-471872239
// https://github.com/facebook/WebDriverAgent/issues/1084
const typeString = async ( driver: wd.PromiseChainWebdriver, element: wd.PromiseChainWebdriver.Element, str: string, clear: boolean = false ) => {
if ( clear ) {
await element.clear();
Expand Down Expand Up @@ -209,7 +207,7 @@ const swipeUp = async ( driver: wd.PromiseChainWebdriver, element: wd.PromiseCha
await action.perform();
};

const toggleHtmlMode = async ( driver: wd.PromiseChainWebdriver ) => {
const toggleHtmlMode = async ( driver: wd.PromiseChainWebdriver, toggleOn: boolean ) => {
if ( isAndroid() ) {
// Hit the "Menu" key
await driver.pressKeycode( 82 );
Expand All @@ -223,7 +221,15 @@ const toggleHtmlMode = async ( driver: wd.PromiseChainWebdriver ) => {
// hit Enter
await driver.pressKeycode( 66 );
} else {
// TODO: toggle html mode in iOS
const menuButton = await driver.elementByAccessibilityId( '...' );
await menuButton.click();
let toggleHtmlButton;
if ( toggleOn ) {
toggleHtmlButton = await driver.elementByAccessibilityId( 'Switch to HTML' );
} else {
toggleHtmlButton = await driver.elementByAccessibilityId( 'Switch To Visual' );
}
await toggleHtmlButton.click();
}
};

Expand Down
Loading

0 comments on commit 300274c

Please sign in to comment.