Skip to content
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

☂️ Help us with E2E Tests #46757

Open
16 of 19 tasks
cipolleschi opened this issue Oct 1, 2024 · 16 comments
Open
16 of 19 tasks

☂️ Help us with E2E Tests #46757

cipolleschi opened this issue Oct 1, 2024 · 16 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo

Comments

@cipolleschi
Copy link
Contributor

cipolleschi commented Oct 1, 2024

Note

This React Native umbrella issue is eligible for Hacktoberfest. Pull requests that contribute to this issue will be labelled as 'hacktoberfest-accepted' and will contribute towards your contest goal.

Description

Hi all,
This is an umbrella issue to collect a set of tasks with the goal of improving our E2E testing, focused on improving the quality of React Native Release.

Having better and faster releases with less human intervention, is beneficial for the community:

  • Lower chances of human error
  • Lower chances of breaking behaviors we can tests

Keep the quality bar for React native high

One of the steps of releasing React Native today is manual testing of some framework functionalities by the release crew.

Manual testing is error prone and it can happen that we miss something while testing a release.

E2E Testing can solve many of those problems:

  • It is automatic, so it will systematically go through all the test cases.
  • Can tests various configurations in parallel
  • Can happen right after the artifacts are ready, reducing the delay between CI and testing

By contributing to this umbrella issue, you can help the community to keep the bar high and ensure that future releases would contain less bugs!

The Current Solution

Few weeks ago, we landed some new Jobs in CI to run tests using Maestro. Maestro is a tool that lets us write E2E tests for React Native using YAML as a definition language. Tests read very natural and are easy to read.

The jobs are already running a very basic test for all the configurations defined above.
You can have a look at those test definitions for RNTester

These tests are currently running on the main branch and on stable branches of React Native.

The Tasks

We are presenting below a list of tasks that any of you can pick up and start working on.

Please comment below if you're willing to take the stance on any of those tasks and wait for a confirmation before starting working on it. Some basic rules:

  • if you claim a task, but don't submit a PR within 2 weeks, we're going to free up that task for someone else.
  • Do not claim more than 2 tasks at the same time

Some tasks will only require you to write a new test using YAML. Some others might require you to touch the JS code of RNTester or of the Template to add some testID or to slightly manipulate the View hierarchy of those apps.

You can have a look at this PR as an example.

How to Test

Before diving into the task list, we want to set you up for success! The best way to do it is to show you how you can test your changes.

Requirements:

  • Your environment should be set up to be able to launch an iOS app and an android app on the simulator.
  • Run brew install jq to install the jq utility, if it is not installed in your system.
  • Install Maestro locally:
    • curl -Ls "https://get.maestro.mobile.dev" | bash
    • brew tap facebook/fb
    • brew install facebook/fb/idb-companion

Test Locally

  • Build the app for Release, from the react-native root folder:
    • iOS:
      yarn install
      cd packages/rn-tester
      yarn e2e-build-ios
      
    • Android:
      yarn install
      cd packages/rn-tester
      yarn e2e-build-android
      
  • Start maestro:
    • iOS:
       cd packages/rn-tester
       yarn e2e-test-ios
      
    • Android:
      cd packages/rn-tester
      yarn e2e-test-android
      

Test In CI

To test in CI, just add a comment on your PR with the text:

/test-e2e

This comment triggers a workflow that starts the Test All workflow with the E2E tests included (they are excluded by default).

Task List

This is the list of tasks. Feel free to add a comment with the task you’d like to work on!

  • [ME2E0001] Rename the file packages/rn-tester/.maestro/start.yml from start.yml to modal.yml. Then, add to the tests the lines to tap on the Show Modal button and expect to find a button Close - Assigned to @ahmedbilal008
  • [ME2E0002] Depends on ME2E0001. Open the test packages/rn-tester/.maestro/modal.yml and add lines to tap on Close and expect to see the button Show Modal - Assigned to @ahmedbilal008
  • [ME2E0003] Update the RNTester example in MyNativeView so that opacity is not random anymore but goes from 1 to 0 in steps of -0.20 (so 1, 0.8, 0.6, 0.4, 0.2, 0). After 0, if the user clicks on Set Opacity, it goes back to 1. - Assigned to @sarthak-d11
  • [ME2E0004] Depends on ME2E0003. Modify the test new-arch-example.yml and add steps to Click on Set Opacity, and verify that the HSBA values change accordingly - Assigned to @poonamjain96
  • [ME2E0005] Modify the test new-arch-example.yml and add steps to Click on Console.log Measure. Verify that the Interop Layer Measurements changes appropriately.
  • [ME2E0006] Update the RNTester example in MyNativeView and add a counter for the LegacyEventStyle fired event. The counter can be rendered right below the button and should increase by 1 every time the button is clicked. - Assigned to @tarunrajput
  • [ME2E0007] Depends on ME2E006. Modify the test new-arch-example.yml and add steps to Click on Fire Legacy Style Event. Verify that the counter increases by 1 after the method is called. - Assigned to @tarunrajput
  • [ME2E0008] Add a new file in the packages/rn-tester/.maestro folder called flatlist.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Flatlist is visible and Clicks on FlatList - Assigned to @l2hyunwoo
  • [ME2E0009] Depends on ME2E0008. Update the packages/rn-tester/.maestro/flatlist.yml to click on the button Basic and scroll down until item 600 is visible. - Assigned to @l2hyunwoo
  • [ME2E0010] Depends on ME2E0008. Update the packages/rn-tester/.maestro/flatlist.yml to click on the switch Empty and verify that the text ”The list is empty :o” is visible - Assigned to @kunalchavhan
  • [ME2E0011] Add a new file in the packages/rn-tester/.maestro folder called button.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Button is visible and Clicks on Button - Assigned to @shubhamguptadream11
  • [ME2E0012] Depends on ME2E0012. Update the button.yml to tap on the Submit Application button. Verify that the dialog appears. Click on Ok to dismiss it. - Assigned to @shubhamguptadream11
  • [ME2E0013] Add a new file in the packages/rn-tester/.maestro folder called pressable.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Pressable is visible and Clicks on Pressable - Assigned to @yasir6jan
  • [ME2E0014] Depends on ME2E0014. Update the pressable.yml to tap on the first Press Me button and verify that the text changes in the box below. You might need to update the PressableExample.js file to discover which identifier you need to use for the first Press Me button. - Assigned to @yasir6jan
  • [ME2E0015] Depends on ME2E0014. Update the pressable.yml to scroll down until the Pressable feedback events box is visible. Tap on the Press me button. Verify that the texts pressIn, press and pressOut are visible. - Assigned to @deepanshushuklad11
  • [ME2E0016] Depends on ME2E0014. Update the pressable.yml to scroll down until the Pressable feedback events box is visible. Long press on the Press me button. Verify that the texts pressIn, longPress and pressOut are visible. - Assigned to @deepanshushuklad11
  • [ME2E0017] Add a new file in the packages/rn-tester/.maestro folder called text.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Text is visible and taps on Text. - Assigned to @muskan27797
  • [ME2E0018] Depends on ME2E0019. Update the text.yml file to scroll down until the box titled Background Color and Border Width box is completely visible. Then assert that all the 5 texts are visible. - Assigned to @muskan27797
  • [ME2E0019] Add a new file in the packages/rn-tester/.maestro folder called image.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Image is visible and taps on Image. Assert that the Plain Network Image with source prop is visible. - Assigned to @sarthak-d11
@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Oct 1, 2024
@cipolleschi cipolleschi pinned this issue Oct 1, 2024
@facebook facebook deleted a comment from react-native-bot Oct 1, 2024
@facebook facebook deleted a comment from react-native-bot Oct 1, 2024
@cortinico cortinico added ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. and removed Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Oct 1, 2024
@ahmedbilal008
Copy link
Contributor

I would like to claim the following tasks:
-[ME2E0001] Rename the file packages/rn-tester/.maestro/start.yml from start.yml to modal.yml. Then, add to the tests the lines to tap on the Show Modal button and expect to find a button Close
-[ME2E0002] Depends on ME2E0001. Open the test packages/rn-tester/.maestro/modal.yml and add lines to tap on Close and expect to see the button Show Modal

@l2hyunwoo
Copy link

I want to take following tasks

[ME2E0008]
Add a new file in the packages/rn-tester/.maestro folder called flatlist.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Flatlist is visible and Clicks on FlatList

[ME2E0009] Depends on ME2E0008. Update the packages/rn-tester/.maestro/flatlist.yml to click on the button Basic and scroll down until item 600 is visible.

@shubhamguptadream11
Copy link
Collaborator

I want to take following tasks:

[ME2E0011] Add a new file in the packages/rn-tester/.maestro folder called button.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Button is visible and Clicks on Button
[ME2E0012] Depends on ME2E0012. Update the button.yml to tap on the Submit Application button. Verify that the dialog appears. Click on Ok to dismiss it.

@muskan27797
Copy link
Contributor

I would like to claim the following tasks:

[ME2E0017] Add a new file in the packages/rn-tester/.maestro folder called text.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Text is visible and taps on Text.
[ME2E0018] Depends on ME2E0019. Update the text.yml file to scroll down until the box titled Background Color and Border Width box is completely visible. Then assert that all the 5 texts are visible.

@sarthak-d11
Copy link
Contributor

I would like to claim the following tasks:

[ME2E0003] Update the RNTester example in MyNativeView so that opacity is not random anymore but goes from 1 to 0 in steps of -0.20 (so 1, 0.8, 0.6, 0.4, 0.2, 0). After 0, if the user clicks on Set Opacity, it goes back to 1.

[ME2E0019] Add a new file in the packages/rn-tester/.maestro folder called image.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Image is visible and taps on Image. Assert that the Plain Network Image with source prop is visible..

@tarunrajput
Copy link
Contributor

I'd like to work on: [ME2E0005] and [ME2E0006]

@yasir6jan
Copy link
Contributor

yasir6jan commented Oct 2, 2024

I would like to work on following tasks:
[ME2E0013], [ME2E0014]

@deepanshushuklad11
Copy link
Contributor

I would like to pick
[ME2E0013], [ME2E0014] ,[ME2E0015] ,[ME2E0016]
Since these tasks are related.

@tarunrajput
Copy link
Contributor

I would like to pick [ME2E0013], [ME2E0014] ,[ME2E0015] ,[ME2E0016] Since these tasks are related.

@deepanshushuklad11, pls pick only two tasks at a time

@kunalchavhan
Copy link
Contributor

I would like to contribute to

  • ME2E0008 - Add a new file in the packages/rn-tester/.maestro folder called flatlist.yml. Copy over the setup from the new-arch-examples.yml to set up a test that starts the app, scrolls until Flatlist is visible and Clicks on FlatList
  • ME2E0010 - Update the packages/rn-tester/.maestro/flatlist.yml to click on the switch Empty and verify that the text ”The list is empty :o” is visible

@cipolleschi
Copy link
Contributor Author

so happy that so many of you already took some tasks!
@ahmedbilal008 @l2hyunwoo @shubhamguptadream11 @muskan27797 @sarthak-d11 @tarunrajput @yasir6jan

@deepanshushuklad11 I assigned you ME2E0015 and ME2E0016 as the other two were already claimed and we have a rule to claim 2 tasks at the same time.
@kunalchavhan I could only assign you ME2E0010 as the other task was taken already!

Feel free to tag me once the PR are ready to be reviewed

@poonamjain96
Copy link
Contributor

I want to work on following tasks:
[ME2E0004], [ME2E0007]

facebook-github-bot pushed a commit that referenced this issue Oct 4, 2024
Summary:
Part of this: #46757
Solves:
- ME2E0011
- ME2E0012

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ Internal ] [ Added ] - Add e2e test for button

Pull Request resolved: #46805

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D63829243

Pulled By: cipolleschi

fbshipit-source-id: 87d8e62650c66fb07e116877a212eff79f10eaf2
facebook-github-bot pushed a commit that referenced this issue Oct 4, 2024
Summary:
Part of this: #46757
Solves:

- ME2E0013
- ME2E0014

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[INTERNAL] [ADDED] - Added E2E for Pressable

Pull Request resolved: #46808

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D63838828

Pulled By: cipolleschi

fbshipit-source-id: a28f654a14fbf7f9b79dedf04f402593042fb4a3
facebook-github-bot pushed a commit that referenced this issue Oct 4, 2024
Summary:
This pr is part of issue #46757 solving tasks [ME2E0001] and [ME2E0002].
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ Internal ] [ Added ] - Add e2e test for modal

Pull Request resolved: #46796

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: cortinico

Differential Revision: D63829299

Pulled By: cipolleschi

fbshipit-source-id: ff64d0babde8aea6e2586c2f69056a10533750f9
facebook-github-bot pushed a commit that referenced this issue Oct 4, 2024
Summary:
Part of this: #46757
Solves:

- ME2E0017
- ME2E0018

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ Internal ] [ Added ] - Add e2e test for button

Pull Request resolved: #46829

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D63889079

Pulled By: cipolleschi

fbshipit-source-id: ca2ede3142d77170fcb4121b025eab56818ffb07
facebook-github-bot pushed a commit that referenced this issue Oct 9, 2024
Summary:
Part of this: #46757
Solves:

ME2E0019
## Changelog:
[ Internal ] [ Added ] - Added a test case for Image
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: #46831

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: cortinico

Differential Revision: D63889719

Pulled By: cipolleschi

fbshipit-source-id: 674879066ec159f11894f24935fe39a86ea1ea63
facebook-github-bot pushed a commit that referenced this issue Oct 9, 2024
Summary:
Part of this: #46757

Solves:
ME2E0015
ME2E0016

## Changelog:

[ Internal ] [ Added ] - Add e2e test for pressable

Pull Request resolved: #46861

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: arushikesarwani94

Differential Revision: D63986636

Pulled By: cipolleschi

fbshipit-source-id: 4b58da97be3c7a14584f0343b6449b407c9517d2
@cipolleschi
Copy link
Contributor Author

@poonamjain96 there has been an issue and @tarunrajput opened #46784 to address ME2E0006 and ME2E0007, instead of 0005 and 0006.

Let me know if you want to work on another task.

@poonamjain96
Copy link
Contributor

No issues @cipolleschi
So now I am picking ME2E0004 and ME2E0005

facebook-github-bot pushed a commit that referenced this issue Oct 10, 2024
Summary:
Part of this: #46757
Solves:

ME2E0003

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ Internal ] [ Changed ] - The opacity logic is changed from random to decrement the opacity by -0.2
For more details, see:

Pull Request resolved: #46830

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D64173519

Pulled By: cipolleschi

fbshipit-source-id: 69a09b64e7e4f098d3bfd72529401dadb49b93d7
@MobinAkhter
Copy link

Hi, @cipolleschi.
I’d like to take up task [ME2E0005] to modify the new-arch-example.yml. Please assign it to me!

@poonamjain96
Copy link
Contributor

poonamjain96 commented Oct 15, 2024

@cipolleschi

[ME2E0004] Depends on ME2E0003. Modify the test new-arch-example.yml and add steps to click on "Set Opacity" and verify that the HSBA values change accordingly.

Problem: When I click on the SetOpacity function, the opacity changes visually, but the HSBA values are not updating. As a result, I can't assert whether the HSBA values are changing in the test cases.

Solution: Instead of validating the HSBA values directly, we could add another text display next to HSBA: h: 0, s: 0, b: 0, a: 0 that shows Opacity: <value>. This would allow us to verify changes in opacity more easily.

Let me know your thoughts on this.

facebook-github-bot pushed a commit that referenced this issue Oct 15, 2024
Summary:
Part of this: #46757
Solves:
- ME2E0005

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ Internal ] [ Added ] - Add console.log measure test in new-arch-example

Pull Request resolved: #47020

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64397112

Pulled By: cipolleschi

fbshipit-source-id: c9192d66065038528751e2e366f58158b06eb864
facebook-github-bot pushed a commit that referenced this issue Oct 15, 2024
Summary:
part of #46757
closes ME2E0006, ME2E0007

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] - add e2e test for Legacy Style Event

Pull Request resolved: #46784

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64172277

Pulled By: cipolleschi

fbshipit-source-id: adf3a55b354f1a293c4620dc617a6a08e3aebd2b
facebook-github-bot pushed a commit that referenced this issue Oct 16, 2024
Summary:
Part of this: #46757
Solves:
- ME2E0004

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ Internal ] [ Added ] - Add setOpacity test in new-arch-example

Pull Request resolved: #47043

Test Plan:
```
yarn e2e-test-ios
yarn e2e-test-android
```

Reviewed By: cortinico

Differential Revision: D64457441

Pulled By: cipolleschi

fbshipit-source-id: 310270293f5c7ec8a94c0d38fdd0897e4591ec14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Help Wanted :octocat: Issues ideal for external contributors. ☂️ Umbrella To label issues that serve as coordination point and drivers for tasks in the react-native repo
Projects
None yet
Development

No branches or pull requests