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

Include UI tests for blocks through Sample App #745

Closed
13 tasks done
JavonDavis opened this issue Mar 13, 2019 · 14 comments
Closed
13 tasks done

Include UI tests for blocks through Sample App #745

JavonDavis opened this issue Mar 13, 2019 · 14 comments
Assignees
Labels
Testing Anything related to automated tests [Type] Enhancement Improves a current area of the editor
Milestone

Comments

@JavonDavis
Copy link
Contributor

JavonDavis commented Mar 13, 2019

We'll need to include an on-device testing solution to help check that everything's good to go as we make changes and include new blocks. I think once we have the following in place we'll be at a good place to start.

CI/CD

Paragraph block

Image block

Heading block

Inserting new blocks

  • Have a post with more than a few blocks. Focus the title block and insert a new block via the Inserter. Verify that the block was added at the end of the post and the view scrolled to it.(This does not happen if the post contains a heading block) Add block insertion tests  #1139
  • Create a post with a few blocks. Focus on the first block and insert a new block via the inserter. Verify that the block appears in its correct position in the post Add block insertion tests  #1139

I think if we can check off all of these we'll be in a good place to start here.


Additional coverage currently includes

  • Copy/paste on plain and rich text content in a paragraph block
  • Rotating device while adding/removing blocks
@JavonDavis JavonDavis self-assigned this Mar 13, 2019
@JavonDavis JavonDavis added [Type] Enhancement Improves a current area of the editor Testing Anything related to automated tests labels Mar 13, 2019
@JavonDavis JavonDavis added this to the Future milestone Mar 13, 2019
@hypest
Copy link
Contributor

hypest commented Mar 15, 2019

Thanks for compiling a list @JavonDavis !

Let's add some writing flow related items. Those are actually the things that are not easy to test in Jest (no access to Aztec itself with no device Jest tests) so it's crucial to add some as baseline to build the testsuite on.

For example:

  • Have a paragraph block with a word in it. Place the cursor in the middle of the work and tap "Enter". Verify that the block split in two paragraph blocks, each with the respective half word.
  • Have two paragraph blocks with some content in each. Place the cursor at the beginning of the second and tap "Backspace". Verify that the blocks merged.
  • Have a post with more than a few blocks. Focus the title block and insert a new block via the Inserter. Verify that the block was added at the end of the post and the view scrolled to it.

What do you think?

@JavonDavis
Copy link
Contributor Author

Let's add some writing flow related items. Those are actually the things that are not easy to test in Jest (no access to Aztec itself with no device Jest tests) so it's crucial to add some as baseline to build the testsuite on.

Ahh I see, makes sense!

What do you think?

I think the idea behind it is totally correct, it's going to take a little more effort technically to accomplish certain actions though, I'll start looking into it. I'll try and rethink the list to cover the ones you mentioned and more of these sort of writing flows alongside the simple ones I included.

@JavonDavis
Copy link
Contributor Author

@hypest I'll also mention that this list was just a starting point to build upon, I mainly wanted to have a good base on the code for interacting with all the blocks to see what's possible(reliably) and what's not and then build on from there. Thanks for mentioning the flows because now I'm thinking to just expand this issue to also include items covering those areas to have an idea what interactions we'll need to keep in mind, I'll organize the description into sections and then we can build on a few more flows to have an idea of where we want to be. Does that sound good?

@hypest
Copy link
Contributor

hypest commented Mar 15, 2019

Sounds awesome @JavonDavis . The starting point is good anyway, it's just that I think with on-device testing, it will actually have higher immediate value if we test a couple of flow-related cases instead of going broad (e.g testing all available blocks). We will eventually want to test everything, but to start it's better to focus on flows. 👍

@hypest
Copy link
Contributor

hypest commented Apr 2, 2019

Can we add a task to write a small guide on how to write a new UI (Appium) test? That would help people start adding tests on their own. Thanks!

@JavonDavis
Copy link
Contributor Author

Can we add a task to write a small guide on how to write a new UI (Appium) test? That would help people start adding tests on their own. Thanks!

Yeah I already started on a separate README file for this, I'll finish this up once we resolve the issues with the merge.

@hypest
Copy link
Contributor

hypest commented Apr 11, 2019

👋 @JavonDavis , I'm thinking, what do you think about adding the following test cases too? For some, my rationale is to help us get some tests in place that exercise our ability to actually test them. Only one test in any of those should be enough to lay the foundation.

  • Test that tapping Enter at the end of a Heading block creates a normal paragraph block beneath it
  • Include one pasting related test. The simplest could be to paste a two-paragraph text snippet and see that we get two paragraph blocks created.
  • Include one device rotation test

@JavonDavis
Copy link
Contributor Author

JavonDavis commented May 9, 2019

my rationale is to help us get some tests in place that exercise our ability to actually test them.

@hypest yeah totally but isn't that the case for what's currently there now? and this would be the aim for all the tests?

The additions you propose sound good! 👍 Could you just clarify what would be the goal for the device rotation test? Just checking that rotating 90 then -90 doesn't break anything?

@JavonDavis
Copy link
Contributor Author

Yeah I already started on a separate README file for this, I'll finish this up once we resolve the issues with the merge.

As previously mentioned I went the route of adding additional information to the project Wiki which is there now 😄 I'll continue to improve it as we build this out some more and point to it in the project README

@mchowning
Copy link
Contributor

mchowning commented May 10, 2019

I went the route of adding additional information to the project Wiki which is there now 😄

Nice! 👍

It might be worth adding a link to that Wiki page in the UI Tests section of the README that you added. Hypothetically speaking, someone who was looking at the UI tests recently might have read the README section but not realized there was also a Wiki page regarding the UI tests (that person 100%, most definitely was not me 😁).

@hypest
Copy link
Contributor

hypest commented May 10, 2019

my rationale is to help us get some tests in place that exercise our ability to actually test them.

@hypest yeah totally but isn't that the case for what's currently there now? and this would be the aim for all the tests?

👋 @JavonDavis , yeap, that's the case, although notice that I was referring as "For some (of the proposed additions)". Sorry it wasn't clear but, I was mainly referring to the pasting and rotation tests for which we don't have the helper methods in place yet to perform. The goal will be to have the helper functions in place so we use them in future tests. Not sure if it's trivial to perform those operations in Appium as is already.

The additions you propose sound good! 👍 Could you just clarify what would be the goal for the device rotation test? Just checking that rotating 90 then -90 doesn't break anything?

Main goal with that one is to be able to have the rotation feature being performed by the automated test. It would then be super useful to use in other tests, where we will be testing out that things continue to look good, that content is preserved, layout is adjusted and generally, whatever test we can think of. But for the scope of this proposal, we'd only need to do the rotation and test something easy/trivial (block content could be it). Let me know if this clears things up, happy to expand!

@JavonDavis
Copy link
Contributor Author

JavonDavis commented Jun 25, 2019

@hypest just a heads up that the PRs for the remaining tasks on this list are ready(some might need to be rebased after a few are merged in but nothing major), I'm going to spend some time working with James on reducing the time they take to execute and stability

@rachelmcr
Copy link
Member

@JavonDavis I see that all the tasks in the issue description are complete. Can we close this issue? If there is any incomplete work here, perhaps we can move it to a new issue for followup.

@JavonDavis
Copy link
Contributor Author

@rachelmcr thanks for the ping on this, closing this since the work on this master issue is complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing Anything related to automated tests [Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

No branches or pull requests

4 participants