-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] Initial HTML E2E test (#26405)
* added initial-html to test-data.js * Added a test that loads all the blocks within a post. * Updated the ci test runners to run gutenberg-editor-blocks * added a function that scrolls to a specific element and returns it. * updated the test to utilize the scroll and return functionality * utilize a shared initialHtml for both test and initial editor content. * added delay to swipe methods. * Remove unneeded code after merging master * Paste instead of typing when setting HTML content * Paste using keycode on Android * Select html content view only on android * Use iOS 14.0 simulator on server * Print driver data on stop * Enable remaining paragraph tests on iOS * Remove dot at the end of jobURL * Print menuButton * Print error if environment cannot be initialized * Revert "Use iOS 14.0 simulator on server" This reverts commit 85178d1. * Revert "Print driver data on stop" This reverts commit f136234. * Revert "Print menuButton" This reverts commit 9e16a13. * Update server appium version to 1.18 and iOS to 14.0 * Add teardown to paste test * On iOS wait for paste notification to disappear * Double tap instead of long press to paste * Fix lint error * On iOS also long press before pasting * On iOS use click instead of clickBeginningOfElement in paragraph test * Scroll to bottom by adding a paragraph block to the end * Use .type on Android instead of pressing paste keycode * Check last block without scrolling on iOS * Update package-lock.json * added endYCoefficient to increase the swipe distance on Android. * added package-lock.json * Retry one more time getting the last block after a delay on iOS * Temporarily delete cancel workflow (and others) to run native jobs multiple times more quickly in consecutive commits * Run 1 * Run 2 * Run 3 * Run 4 * Run 5 * Run 6 * Run 7 * Run 8 * Revert "Temporarily delete cancel workflow (and others) to run native jobs multiple times more quickly in consecutive commits" This reverts commit fe5a1b1. * Temporarily delete cancel workflow * Run 1 * Run 2 * Run 3 * Run 4 * Run 5 * Run 6 * Run 7 * Run 8 * Temporarily delete non-native workflows * Bump reactivecircus/android-emulator-runner action to v2.15.0 * Run 1 * Run 2 * Run 3 * Run 4 * Run 5 * Run 6 * Run 7 * Run 8 * Run 9 * Run 10 * Run 11 * Run 12 * Run 13 * Run 14 * Run 15 * Run 16 * Revert "Temporarily delete cancel workflow" This reverts commit b31695a. * Revert "Temporarily delete non-native workflows" This reverts commit ff5a3c4. * Rename test file Co-authored-by: Ceyhun Ozugur <ceyhunozugur@gmail.com>
- Loading branch information
1 parent
87db183
commit 58dc864
Showing
9 changed files
with
180 additions
and
79 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
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-initial-html.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.