-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[RNMobile] Initial HTML E2E test #26405
Merged
Merged
Changes from 83 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
34ec8f0
added initial-html to test-data.js
jd-alexander e7194c6
Added a test that loads all the blocks within a post.
jd-alexander e94dce5
Updated the ci test runners to run gutenberg-editor-blocks
jd-alexander 4f76cbc
added a function that scrolls to a specific element and returns it.
jd-alexander 816b273
updated the test to utilize the scroll and return functionality
jd-alexander bdd999b
utilize a shared initialHtml for both test and initial editor content.
jd-alexander 15ff496
added delay to swipe methods.
jd-alexander aaf6f9a
Merge branch 'master' into rnmobile/initial_html_test
ceyhun fb5b445
Remove unneeded code after merging master
ceyhun 5a4a97f
Paste instead of typing when setting HTML content
ceyhun ae7eee6
Paste using keycode on Android
ceyhun c6c8f83
Select html content view only on android
ceyhun 85178d1
Use iOS 14.0 simulator on server
ceyhun f136234
Print driver data on stop
ceyhun 6749d83
Enable remaining paragraph tests on iOS
ceyhun 99d028d
Remove dot at the end of jobURL
ceyhun 9e16a13
Print menuButton
ceyhun cf9f538
Print error if environment cannot be initialized
ceyhun 4f9e027
Revert "Use iOS 14.0 simulator on server"
ceyhun b8bce5c
Revert "Print driver data on stop"
ceyhun ffa7871
Revert "Print menuButton"
ceyhun a26ae92
Update server appium version to 1.18 and iOS to 14.0
ceyhun 9401e28
Add teardown to paste test
ceyhun e8402b3
On iOS wait for paste notification to disappear
ceyhun 874319e
Double tap instead of long press to paste
ceyhun 63fa606
Fix lint error
ceyhun 7a03e76
On iOS also long press before pasting
ceyhun 206048e
On iOS use click instead of clickBeginningOfElement in paragraph test
ceyhun fabb5b4
Scroll to bottom by adding a paragraph block to the end
ceyhun 20ab417
Use .type on Android instead of pressing paste keycode
ceyhun 17c0ac9
Merge branch 'master' into rnmobile/initial_html_test
ceyhun cde7701
Check last block without scrolling on iOS
ceyhun 6b50987
Update package-lock.json
ceyhun 59f3b94
added endYCoefficient to increase the swipe distance on Android.
jd-alexander 26c8f76
Merge branch 'master' into rnmobile/initial_html_test
jd-alexander 2c84369
added package-lock.json
jd-alexander 8954975
Merge branch 'trunk' into rnmobile/initial_html_test
jd-alexander 5d1a932
Merge branch 'trunk' into rnmobile/initial_html_test
jd-alexander 1a52d15
Merge branch 'trunk' into rnmobile/initial_html_test
ceyhun 552721a
Merge branch 'trunk' into rnmobile/initial_html_test
jd-alexander be5d71b
Retry one more time getting the last block after a delay on iOS
ceyhun fe5a1b1
Temporarily delete cancel workflow (and others) to run native jobs mu…
ceyhun 95b94ef
Run 1
ceyhun 4e82557
Run 2
ceyhun 36436c6
Run 3
ceyhun fc56a71
Run 4
ceyhun 847114d
Run 5
ceyhun ace54df
Run 6
ceyhun 4237c56
Run 7
ceyhun caf324c
Run 8
ceyhun 6433d2a
Revert "Temporarily delete cancel workflow (and others) to run native…
ceyhun 85dccc7
Merge branch 'trunk' into rnmobile/initial_html_test
ceyhun b31695a
Temporarily delete cancel workflow
ceyhun 3eef3c6
Run 1
ceyhun 99a2457
Run 2
ceyhun d369139
Run 3
ceyhun 5346120
Run 4
ceyhun 9f7c575
Run 5
ceyhun 8c7d926
Run 6
ceyhun 80f79c5
Run 7
ceyhun a49bd8a
Run 8
ceyhun 0ec4ca5
Merge branch 'trunk' into rnmobile/initial_html_test
ceyhun ff5a3c4
Temporarily delete non-native workflows
ceyhun 8944637
Bump reactivecircus/android-emulator-runner action to v2.15.0
ceyhun e95740f
Run 1
ceyhun 7185703
Run 2
ceyhun 14aff0f
Run 3
ceyhun a281149
Run 4
ceyhun 968ec08
Run 5
ceyhun 50795ad
Run 6
ceyhun 7996123
Run 7
ceyhun 7c656e2
Run 8
ceyhun fc6353f
Run 9
ceyhun b916bd4
Run 10
ceyhun 9e0db5b
Run 11
ceyhun 667c99a
Run 12
ceyhun 972a472
Run 13
ceyhun 603f27e
Run 14
ceyhun 78bfdf0
Run 15
ceyhun 376373a
Run 16
ceyhun 3de14a6
Merge branch 'trunk' into rnmobile/initial_html_test
ceyhun ad6e0d7
Revert "Temporarily delete cancel workflow"
ceyhun d5a33b5
Revert "Temporarily delete non-native workflows"
ceyhun b3a63cb
Merge branch 'trunk' into rnmobile/initial_html_test
ceyhun 6ad45cc
Rename test file
ceyhun 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
39 changes: 39 additions & 0 deletions
39
packages/react-native-editor/__device-tests__/gutenberg-editor-blocks.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,39 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import initialHtml from '../src/initial-html'; | ||
import { isAndroid } from './helpers/utils'; | ||
|
||
describe( 'Gutenberg Editor Blocks test', () => { | ||
it( 'should be able to create a post with all blocks and scroll to the last one', async () => { | ||
await editorPage.setHtmlContent( initialHtml ); | ||
|
||
const lastBlockAccessibilityLabel = | ||
'This block is used in initial HTML e2e tests and should be kept as the last block.'; | ||
let lastBlockElement; | ||
if ( isAndroid() ) { | ||
lastBlockElement = await editorPage.androidScrollAndReturnElement( | ||
lastBlockAccessibilityLabel | ||
); | ||
} else { | ||
lastBlockElement = await editorPage.getLastElementByXPath( | ||
lastBlockAccessibilityLabel | ||
); | ||
if ( ! lastBlockElement ) { | ||
const retryDelay = 5000; | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
`Warning: "lastBlockElement" was not found in the first attempt. Could be that all the blocks were not loaded yet. | ||
Will retry one more time after ${ retryDelay / 1000 } seconds.`, | ||
lastBlockElement | ||
); | ||
await editorPage.driver.sleep( retryDelay ); | ||
lastBlockElement = await editorPage.getLastElementByXPath( | ||
lastBlockAccessibilityLabel | ||
); | ||
} | ||
} | ||
|
||
expect( lastBlockElement ).toBeTruthy(); | ||
} ); | ||
} ); |
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.
What do you think about renaming this to
gutenberg-editor-initial-html
and also keepinggutenberg-editor-gallery
, but maybe making them run one after another instead of running in parallel?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 agree with the renaming. What is the rationale for keeping the gallery test ? I thought this test would cover all cases and I'm wondering if that test could be more flaky than this one. Also I'm wondering about the collective time of both them running one after the other as well. Let me know what you think.
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.
To be honest, I'm not interested in gallery block in this case 😄 But the gallery test checks some other aspects of the editor that are not covered by the initial HTML tests, mainly around the inserter menu, like opening the inserter menu, scrolling the inserter menu, and inserting a block.
The primary time-consuming task is building the js bundle and the native code (the ipa and the apk). The gallery test itself runs in ~5 seconds on iOS and ~50 seconds on Android. Android is slower due to iOS having a larger inserter, so there's no need to scroll the inserter to find the gallery block on iOS.
Gallery test has been around for quite some time now, and I think it should be stable enough. But I realized now that we had made some changes around scrolling in this PR, that could be affecting the gallery test's stability. So it could be better to leave the gallery test out for now and maybe add it back in, in a separate PR making sure again it's flawless 💯
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 understand. This makes a lot of sense.
Sounds like a good plan to me to re-add it after we have done some more tests! Thanks for expounding here @ceyhun