-
Notifications
You must be signed in to change notification settings - Fork 58
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
Release v1.10.0 #1246
Merged
Merged
Release v1.10.0 #1246
Changes from all commits
Commits
Show all changes
193 commits
Select commit
Hold shift + click to select a range
5fe7da5
add image block and select image from wordpress media library(mostly …
JavonDavis af95746
reenable remaining list test
JavonDavis 50a721e
test for multiple heading blocks and paragraph blocks
JavonDavis 27ae229
fix heading block function call
JavonDavis d8eaae6
use longer test data
JavonDavis ff37242
update submodule
JavonDavis 37bc1d9
remove xdescribe
JavonDavis 7aae7d4
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis bad274c
use empty image block for android tests
JavonDavis 24b91f1
merge develop
JavonDavis a5b276d
fix lint error
JavonDavis b11783e
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis baf8ac0
resolve conflicts with develop
JavonDavis 8246b68
merge develop
JavonDavis eb88920
merge develop and workaround for #952
JavonDavis 5ee597b
fix lint and test data
JavonDavis 0f82cf2
add title element for android too
JavonDavis 9df6cdf
Add block insertion tests with html verification
JavonDavis 9135f49
fix submodule
JavonDavis 9929d7e
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis ceb5a72
fix issue caused by not properly deleting blocks
JavonDavis ff1650c
clicking on middle of element to avoid ios new block creation
JavonDavis 3b980c9
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis 99de16e
Update GB reference.
SergioEstevao e4e311e
Update mocks for tests.
SergioEstevao 4b03ca2
Update GB reference.
SergioEstevao 9fbe8aa
Use non default device on Sauce
JavonDavis 610da4e
use branch specific app files
JavonDavis 3be41ca
Move AppContainer and MainScreen to @wordpress/edit-post as Editor an…
Tug 258c692
Update gutenberg ref
Tug 05ee1b6
add a prestep for creating sage filename
JavonDavis 7a9f12f
use correct name in utils
JavonDavis b7b7ac5
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis b232607
update cache keys
JavonDavis ad97bd9
upgrade circleci image to api 29
JavonDavis 041127f
upgrade circleci image to api 29
JavonDavis 1ac420a
delete differently
JavonDavis 41a18be
delete differently
JavonDavis e5da2df
delete differently on ios vs android
JavonDavis c354d52
Update GB reference.
SergioEstevao 4d20727
remove runInBand
JavonDavis 78debf3
serparate local run to not run in parallel
JavonDavis 3aadc6b
try increasing number of workers to max vms in sauce
JavonDavis fdd4b23
revert max workers
JavonDavis b62d556
Update GB reference.
SergioEstevao eb2beb8
Merge branch 'develop' into try/move_richtext
SergioEstevao 9981785
Update gutenberg ref
Tug ba480c7
Update GB reference.
SergioEstevao 9977eb8
Merge pull request #1154 from wordpress-mobile/try/move_richtext
SergioEstevao 99c4c3c
Update gutenberg after merge
Tug 89dc55c
Merge remote-tracking branch 'origin/develop' into update/move-appcon…
Tug e83c7d8
Merge pull request #1171 from wordpress-mobile/update/move-appcontain…
Tug ab569ca
Upgrade node-sass
Tug 9dc16d6
Merge pull request #1180 from wordpress-mobile/try/parallel-device-tests
JavonDavis bb97dac
Run yarn upgrade to metro-core/fsevents build error
Tug 468d46b
iOS brdige: Avoid logging if threshold is higher than log level
etoledom 78768c4
iOS Bridge: Add fatal log level and helper inits
etoledom 15b08cd
iOS Bridge: Set log threshold to error if packager is not running
etoledom 55da325
Update gutenberg ref
pinarol c2ecda4
Update gutenberg ref
pinarol 0ab143e
Update gutenberg ref
pinarol 5a70628
Update gutenberg ref
pinarol 6526be3
Merge branch 'master' into master-v1.8.0-to-develop
hypest dd2a5ae
Merge pull request #1185 from wordpress-mobile/master-v1.8.0-to-develop
hypest 29b1e14
Merge pull request #1183 from wordpress-mobile/issue/reduce-ios-bridg…
etoledom 117b82f
CircleCI: Speed up iOS device tests by caching gutenberg.app
jtreanor b173bb4
CircleCI: Cache i18n-cache/data to speed up 'yarn install'
jtreanor b322a82
CircleCI: Cache node_modules instead of the yarn cache and use yarn i…
jtreanor 5d9b330
CircleCI: Use separate yarn cache for each job
jtreanor 3f04ad0
Update gutenberg ref
pinarol 13d0dd8
Merge branch 'develop' into issue/1173-video-block-upload-fail
pinarol 8f1cda9
Update gutenberg ref
pinarol 4352a51
Merge pull request #1189 from wordpress-mobile/ci/cache-locales
hypest 6bf532c
Update gutenberg ref
pinarol 1842c6c
Merge branch 'develop' into issue/1173-video-block-upload-fail
pinarol 0a0bc04
Merge pull request #1188 from wordpress-mobile/speedup-ui-tests
jtreanor 170220a
Merge branch 'develop' into issue/1173-video-block-upload-fail
pinarol f6c98f5
Adding `navigator.userAgent` to our globals to solve a crash updating…
etoledom ef09049
Merge pull request #1195 from wordpress-mobile/issue/fix-window-navig…
etoledom 516b1f9
Bump handlebars from 4.0.11 to 4.1.2 in /react-native-aztec/example
dependabot[bot] 61a5215
Update gutenberg ref
etoledom 907adae
Merge branch 'develop' into issue/1173-video-block-upload-fail
etoledom c66d53c
Merge pull request #1196 from wordpress-mobile/dependabot/npm_and_yar…
hypest 0028130
GB will now send the list of unsupported blocks found in the current …
daniloercoli b1f58b8
Update GB hash
daniloercoli 5797732
Merge branch 'develop' into add/tests-add-block-insertion
JavonDavis 7a9a3ea
Mobile app crashes when the user merges two blocks (#1203)
marecar3 c3cf2b1
Update gutenberg ref
etoledom d768f57
Merge branch 'develop' into issue/1173-video-block-upload-fail
etoledom 050cdc7
Implementing unsupportedBlockNames bridge callback on iOS
etoledom 39e7112
Update GB ref
daniloercoli 02fe01c
Update GB ref after merge master into our gb branch
daniloercoli 69d43d2
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
daniloercoli 4b84ada
Update gb ref
daniloercoli 544ca0c
Tapping on an empty editor area creates a new paragraph block (#1200)
marecar3 34eb866
fixed issues with tests moving a little too fast sometimes when runni…
JavonDavis ce6408f
Update gutenberg ref
etoledom 7ee2d3b
Merge branch 'develop' into issue/1174-track-unsupported-blocks
etoledom d9fa4a4
Update gutenberg ref
etoledom 90d52df
Merge branch 'develop' into issue/1173-video-block-upload-fail
etoledom d5992dd
Merge pull request #1182 from wordpress-mobile/issue/1173-video-block…
etoledom 6d03ee9
Update gutenberg ref to master
etoledom d64cf0b
Merge branch 'develop' into issue/1174-track-unsupported-blocks
etoledom f066d3b
Merge pull request #1199 from wordpress-mobile/issue/1174-track-unsup…
etoledom 29f741b
Update JS bundles
etoledom e76549a
Merge branch 'develop' into issue/update-js-bundles
etoledom b6daeaa
Update bundles to latests develop
etoledom 05021a6
Point gutenberg reference to update/parser-reserialize-unknown-blocks
Tug 98603eb
Update RELEASE-NOTES.txt
Tug e030b81
Update RELEASE-NOTES.txt
Tug e84a7e1
Update README.md to use the latest npm version
Tug 893108e
Rename jsdom-jscore dependency to jsdom-jscore-rn
Tug c0c5ea5
Merge remote-tracking branch 'origin/develop' into fix/support-node-1…
Tug 225ec1a
Update gutenberg ref to master
Tug c8d9c22
merge develop
JavonDavis 9d5b155
Update gutenberg ref after merge
Tug 44e263c
Merge pull request #1209 from wordpress-mobile/try/fix-parser-reseria…
Tug ff16006
update comment and resolve gutenberg conflict
JavonDavis 117eae0
Update gutenberg ref
mchowning 5d335f7
Merge pull request #1207 from wordpress-mobile/fix/android-device-tests
JavonDavis 523031e
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis 6a097d0
Merge pull request #1201 from wordpress-mobile/issue/632-insert-post-…
mchowning 9589f65
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis dc9ccee
fix issue with keyboard not being hidden on iOS device tests
JavonDavis fb61146
swipe up to show caption field instead of trying to dismiss keyboard
JavonDavis 57b9613
Merge pull request #1060 from wordpress-mobile/add/tests-image-block
JavonDavis 523e5f8
updated comment to be more consistent
JavonDavis 933f210
remove false comments
JavonDavis b015592
Merge pull request #1208 from wordpress-mobile/issue/update-js-bundles
daniloercoli ad46d41
Track develop gutenberg ref
Tug 0a8bdd7
Merge remote-tracking branch 'origin/develop' into fix/support-node-1…
Tug 5ec7042
Merge pull request #1181 from wordpress-mobile/fix/support-node-12.2plus
Tug a539743
Merge pull request #1069 from wordpress-mobile/add/tests-heading-block
JavonDavis 07264e8
Update gutenberg ref
etoledom bc8a535
Update jest config file
etoledom ee39a64
Update react-dom to solve invariant error.
etoledom 07e4042
Update gutenberg ref
etoledom ac1ec3b
Add back local tests
etoledom 014b641
Fix test warnings
etoledom de453de
Remove duplicated test config files
etoledom 938d989
Fix lint issues
etoledom ec73e52
AndroidX migration (#1112)
marecar3 5ab6353
resolved test issues with merge
JavonDavis d28a01f
resolve ci changes
JavonDavis e44f34e
remove "its" from test data
JavonDavis c6a979b
try no cache option with jest to fix issue with tests not running in …
JavonDavis 07a675d
try no cache option with jest to fix issue with tests not running in …
JavonDavis 0a371c2
add max workers to jest command
JavonDavis 987bb4a
remove detect open handles
JavonDavis f297209
Update gutenberg hash
etoledom c229dfa
Merge branch 'develop' into issue/run-tests-on-gutenberg-repo
etoledom f4ee8b6
Update gutenberg ref
etoledom eaed8c5
Merge pull request #1215 from wordpress-mobile/issue/run-tests-on-gut…
etoledom 173c49e
add docs to readme and contributing
JavonDavis 050752f
Update README.md
JavonDavis b70ce37
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis 2cf5fe7
rename test to match new scenario
JavonDavis 560efc2
update submodule
JavonDavis 849a315
reduce max workers and increase timeout length to reduce driver colli…
JavonDavis 251d571
Merge pull request #1139 from wordpress-mobile/add/tests-add-block-in…
JavonDavis 5664e34
Merge branch 'develop' of https://github.com/wordpress-mobile/gutenbe…
JavonDavis 7c38ccc
merge develop and update submodule
JavonDavis 2a064da
Merge branch 'add/test-documentation-readme' of https://github.com/wo…
JavonDavis 9861118
update README
JavonDavis 66b5e98
update README
JavonDavis 1359404
point to UI test README in project README
JavonDavis bb430c9
Update gutenberg ref
mchowning a4dacee
Merge pull request #1228 from wordpress-mobile/remove_image_component…
mchowning 3ff59f1
fix contribution url
JavonDavis 3d4d946
add link to contributing guide in README
JavonDavis 507ee91
clarify how the config file is used
JavonDavis fd111e0
Merge pull request #1223 from wordpress-mobile/add/test-documentation…
JavonDavis 98341ad
Release v1.9 (#1216)
marecar3 a460c08
Update gutenberg ref and release notes
mchowning 5d0be02
Update release notes
mchowning 66dd13d
Update gutenberg ref
mchowning 5e100b0
Merge pull request #1231 from wordpress-mobile/issue/932_blur-post-title
mchowning 14af3b0
Update gutenberg ref
mchowning ba27f29
Update release notes
mchowning c96a3c5
Merge pull request #1227 from wordpress-mobile/issue/632-replace-init…
mchowning cf82f89
Update vscode extension config to prevent VSCode to show a warning on…
maxme b5f01e9
Merge pull request #1241 from wordpress-mobile/update/vs-code-extensi…
hypest 4778a43
Remove references to node 9 errors in readme
mchowning 86d5d34
Update release notes
mchowning 098cd68
Update gutenberg ref
mchowning 53811c1
Merge pull request #1243 from wordpress-mobile/issue/image-block-igno…
mchowning 8a3cb05
Bump version to 1.10.0
Tug f01084c
Update bundles
Tug 85859f7
Merge remote-tracking branch 'origin/master' into release/1.10.0
Tug bfb2c43
Update RELEASE-NOTES.txt
Tug 421c89f
Update gutenberg ref
Tug d6a551a
Remove obsolete release note item
Tug b4dd27f
Update bundles
Tug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"gcazaciuc.vscode-flow-ide", | ||
"vsmobile.vscode-react-native" | ||
"msjsdiag.vscode-react-native" | ||
] | ||
} |
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
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
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,44 @@ | ||
Writing a UI test? Great! 😬 This guide is here to help fill in some of the blanks of how the tests are written now and how you can add a new one. | ||
|
||
You can find our on-device UI tests in the `__device-tests__` folder and that's where all of the code for that really lives. | ||
The test suite follows a sort of [Page Object Pattern](https://webdriver.io/docs/pageobjects.html), the `__device-tests__/pages/editor-page.js` manages all interactions with the pages and the `__device-tests__/gutenberg-editor.test.js` actually uses the functions made available via the Page Object `EditorPage` to drive the test cases. At the time of writing this, all the tests live there but as the suite gets large it might be better to manage different classes of tests in different files. | ||
|
||
So what does the process for writing a test look like? Here are some steps that I hope can help make this easier, | ||
|
||
### First, define the scenario | ||
|
||
- What are the actions that need to take place here? Walk through the scenario and manually to have an idea of what the test steps will need to do, the elements you'll need to interact with and how you're going to need to interact with them. I found it helps to properly define the steps taken in the scenario and the different user interactions that are needed to accomplish it. | ||
|
||
You'd just add a new scenario to the test file as well that would look something like, | ||
|
||
```javscript | ||
it( 'should be able to do something', async () => { | ||
// Code to do something... | ||
} ); | ||
``` | ||
|
||
That first parameter in the block above is where you'd put a short description of the scenario while the next parameter is the code you'd like to execute. | ||
|
||
### Second, figure out how to find the elements | ||
|
||
- The UI tests rely on locator strategies to identify elements... There's a number of locator strategies available to use and [this blog post](https://saucelabs.com/blog/advanced-locator-strategies) describes in a little more detail what a few of these are and how to use them. You'll need to start thinking about what locator strategy you'll need to use to find the elements you need if it isn't already available. | ||
- The preferred strategy is the accessibility identifier and in a lot of cases this might not be possible and you'll have to resort to other less robust alternatives such as XPath. | ||
|
||
There's a few tools you have available to figure out what you need. | ||
|
||
For Android, you can fire up the app and then within Android Studio select `Tools -> Layout Inspector` which will then open up a `.li` file which you can then use to inspect various areas of the app, here's a [screenshot](https://d.pr/free/i/anU50R) of what that looks like. | ||
|
||
For iOS, you can also fire up and use the accessibility inspector, which is an app that should come available on your OSX machine. From there you can choose the process running your simulator and inspect various areas of the app. | ||
|
||
Alternative for both of these platforms and for an interface to simulate the commands I'd recommend [Appium Desktop](https://github.com/appium/appium-desktop/releases/tag/v1.12.1). A great tool for inspecting the view hierarchy and interacting with elements on screen as your test would. Here's a [screenshot](https://d.pr/free/i/GziQ5Q) of what that would look like. | ||
|
||
Using one or a combination of these tools will make it much easier to identify what locator strategy you're going to use or which elements need accessibility identifiers to ease the search process without affecting VoiceOver features. | ||
|
||
### Finally, once you've figured out how you're going to find the elements | ||
|
||
- You'll write any functions needed to interact with the page in the `EditorPage` page object and then call those interactions within the test. The code you'll need to write to actually do the finding will use a combination of | ||
|
||
- Appium's spec http://appium.io/docs/en/about-appium/intro/ which you can find examples of a variety of functions under the commands tab | ||
- WebDriver I/O Appium protocols https://webdriver.io/docs/api/appium.html which provides examples and descriptions of what those look like. | ||
|
||
It takes some getting use to but looking at the existing code should be helpful in identifying common commands that it'd help to be familiar with. |
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,56 @@ | ||
# Overview | ||
|
||
We use [appium](http://appium.io/) combined with [SauceLabs](https://saucelabs.com/) as an on-device testing solution for covering writing flows using Gutenberg blocks. | ||
|
||
Appium is built on the idea that testing native apps shouldn't require including an SDK or recompiling your app. And that you should be able to use your preferred test practices, frameworks, and tools. Appium is an open source project and has made design and tool decisions to encourage a vibrant contributing community. | ||
|
||
SauceLabs is a cloud hosting platform that provides access to a variety of simulators, emulators and real devices. | ||
|
||
## Getting set up to run the tests | ||
|
||
### Emulators && Simulators | ||
|
||
iOS: Once you've already set up XCode and the simulators you should be good to go to run the tests on an iOS simulator. | ||
|
||
Android: You'll need to have created the emulator images and fired up the desired emulator before running the tests against an Android emulator. | ||
|
||
### Real Devices | ||
|
||
TBA | ||
|
||
## Running the tests locally | ||
|
||
TLDR; to run the tests locally ensure metro isn't running and then run `yarn test:e2e:ios:local` and `yarn test:e2e:android:local` for the desired platform. | ||
|
||
Those commands include the process to build a testable version of the app, if it's the case you don't want to run the | ||
full suite and want to run a specific file or files you can use the e2e build commands that can be found in the package.json for the respective platform and then | ||
run `TEST_RN_PLATFORM=android yarn device-tests <pattern>` where the pattern can just be the file path. | ||
|
||
### Starting the Appium Server | ||
|
||
One of the Caveats to using Appium is the need for the Appium server to be running to interact with the Simulator or Device through Webdriver, as a result the appium server will need to be started before running the tests. To make the entire process easier in the `beforeAll` block of the tests an Appium instance is fired up on a default port of 4723. If you already have something running on that port and would rather not stop that you can change the port within the code that starts that up. At the moment that port number is referenced from the config located at `__device-tests__/helpers/serverConfigs.js`. The process is killed in the `afterAll` block but at the time of writing this there's a small chance some errors might cause it not to get there so it might be best to kill the process yourself if you think something is up. The server output when running the tests are written to `appium-out.log`, this can provide useful information when debugging the issues with the tests. | ||
|
||
### WebDriver capabilities | ||
|
||
Appium uses a config object that contains `capabilities` to define how it will connect to a simulator or device, this object is currently located in `__device-tests__/helpers/caps.js` and then referenced when firing up the driver. There are two values that I think are important to know and that's | ||
|
||
- `platformVersion` which is the platform version of a connected adb device. e.g `9.0` for Android or `12.2` for iOS. The version used here is upper bounded by the max allowed on CI but feel free to change this value locally as needed. | ||
- `app` which is the absolute path to the `.app` or `.apk` file or the path relative to the **Appium root**. It's important to note that that when using the relative paths it's not to the project folder but to the appium server, since by default we start up appium in the project root when running the paths appear relative to the root but if you were using another instance of the Appium server the relative path would need to come from there. | ||
|
||
A full spec on the capabilities can be found [here](http://appium.io/docs/en/writing-running-appium/caps/). If you'd like to change configurations like | ||
what port appium runs on or what device or emulator the tests should be executed on that file would be where you'd like to make that update. | ||
|
||
## The run process | ||
|
||
At the moment when running locally, the app attempts to fire up an appium server and then connects to it via webdriver. Then | ||
|
||
* on Android, a debug version of the app is bundled, built, and used. | ||
* on iOS a release version is bundled built and used. | ||
|
||
**It's important to ensure that **metro is not running.** This would cause the value of the `__DEV__` variable to be true and load up the sample blocks.** | ||
|
||
After the build is complete, an appium server is fired up on port 4723 and the device tests are ran on the connected device/simulator. | ||
|
||
----- | ||
|
||
To read more about writing your own tests please read the [contributing guide](https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/__device-tests__/CONTRIBUTING.md) |
114 changes: 114 additions & 0 deletions
114
__device-tests__/gutenberg-editor-block-insertion.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,114 @@ | ||
/** | ||
* @format | ||
* */ | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import EditorPage from './pages/editor-page'; | ||
import { | ||
setupDriver, | ||
isLocalEnvironment, | ||
stopDriver, | ||
isAndroid, | ||
clickMiddleOfElement, | ||
} from './helpers/utils'; | ||
import testData from './helpers/test-data'; | ||
|
||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 300000; | ||
|
||
describe( 'Gutenberg Editor tests for Block insertion', () => { | ||
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 insert block into post', async () => { | ||
await editorPage.addNewParagraphBlock(); | ||
let paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 ); | ||
if ( isAndroid() ) { | ||
await paragraphBlockElement.click(); | ||
} | ||
await editorPage.sendTextToParagraphBlockAtPosition( 1, testData.longText ); | ||
// Should have 3 paragraph blocks at this point | ||
|
||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 2 ); | ||
await paragraphBlockElement.click(); | ||
|
||
await editorPage.addNewParagraphBlock(); | ||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 3 ); | ||
await paragraphBlockElement.click(); | ||
await editorPage.sendTextToParagraphBlockAtPosition( 3, testData.mediumText ); | ||
|
||
await editorPage.verifyHtmlContent( testData.blockInsertionHtml ); | ||
|
||
// Workaround for now since deleting the first element causes a crash on CI for Android | ||
if ( isAndroid() ) { | ||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 3 ); | ||
await paragraphBlockElement.click(); | ||
await editorPage.removeParagraphBlockAtPosition( 3 ); | ||
for ( let i = 3; i > 0; i-- ) { | ||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( i ); | ||
await paragraphBlockElement.click(); | ||
await editorPage.removeParagraphBlockAtPosition( i ); | ||
} | ||
} else { | ||
for ( let i = 4; i > 0; i-- ) { | ||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 ); | ||
await clickMiddleOfElement( driver, paragraphBlockElement ); | ||
await editorPage.removeParagraphBlockAtPosition( 1 ); | ||
} | ||
} | ||
} ); | ||
|
||
it( 'should be able to insert block at the beginning of post from the title', async () => { | ||
await editorPage.addNewParagraphBlock(); | ||
let paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 ); | ||
if ( isAndroid() ) { | ||
await paragraphBlockElement.click(); | ||
} | ||
await editorPage.sendTextToParagraphBlockAtPosition( 1, testData.longText ); | ||
// Should have 3 paragraph blocks at this point | ||
|
||
if ( isAndroid() ) { | ||
await driver.hideDeviceKeyboard(); | ||
} | ||
|
||
const titleElement = await editorPage.getTitleElement(); | ||
await titleElement.click(); | ||
await titleElement.click(); | ||
|
||
await editorPage.addNewParagraphBlock(); | ||
paragraphBlockElement = await editorPage.getParagraphBlockAtPosition( 1 ); | ||
await clickMiddleOfElement( driver, paragraphBlockElement ); | ||
await editorPage.sendTextToParagraphBlockAtPosition( 1, testData.mediumText ); | ||
await paragraphBlockElement.click(); | ||
await editorPage.verifyHtmlContent( testData.blockInsertionHtmlFromTitle ); | ||
} ); | ||
|
||
afterAll( async () => { | ||
if ( ! isLocalEnvironment() ) { | ||
driver.sauceJobStatus( allPassed ); | ||
} | ||
await stopDriver( driver ); | ||
} ); | ||
} ); |
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
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
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is one final edge case for this (adding from the post title on a new post when there is just the placeholder text and no paragraph block yet) is still not fixed. Should we pull this from the release notes until that is fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as it's included in this release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aww, but that screws up my plan of changing all the release notes. 😉