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

Extend e2e code coverage #56

Open
40 of 49 tasks
queleok opened this issue Aug 21, 2021 · 1 comment
Open
40 of 49 tasks

Extend e2e code coverage #56

queleok opened this issue Aug 21, 2021 · 1 comment
Assignees
Labels

Comments

@queleok
Copy link
Owner

queleok commented Aug 21, 2021

1. Styling of published words

With the styling of published words everything is simple, they should be published in the reverse order, and they are always in one of four states: successful, failure, network-failure (maybe I should rename this to recoverable-failure), or pending. The first two are already covered, so I only need to cover the last two, which implies:

  • 1. confirm words with responses other than 200 and 404 are published as network-failure
  • 2. confirm successful resend of the recoverably failed word yields the update of its style
  • 3. confirm right after the send button is pressed, the word is published as pending until its resolution (should really be just a step in each test for other types)

2. Results calculation & processing

With results there are a few things to consider. First of all, the basic result calculation should be verified, i.e. the tests should:

  • 1. confirm 1 successful word of 3 letters results in score 1
  • 2. confirm 2 successful words of 3 and 4 letters result in score 3
  • 3. confirm 2 successful words of 3 and 4 letters and one failed word of 6 letters result in score 3
  • 4. confirm 3 failed words of arbitrary lengths result in score 0
  • 5. confirm 3 network-failed words of arbitrary lengths result in score 0
  • 6. confirm successful resend of the network-failed word of 3 letters increases the result by 1
  • 7. confirm successful resend of the two network-failed words of 3 and 4 letters increases the result by 3

Somewhat more complicated to cover would be the following:

  • 8. confirm results get into pending state (and do not contain any score) if there is a pending word when the time runs out
  • 9. confirm pending results are published (and correct) after the last pending word is resolved

3. Network issues disclaimer

There should also be tests that

  • 1. confirm the network issues disclaimer appears if there were recoverably failed words
  • 2. confirm the disclaimer contains the button pressing which initiates an attempt of recovery
  • 3. confirm the network issues disclaimer disappears after the last recoverably failed word is resolved

4. Word publishing

  • 1. confirm word publishing is initiated by pressing Enter from the keyboard if the input contains only alphabetical symbols in different cases
  • 2. confirm word publishing is initiated by pressing the send button if the input contains only alphabetical symbols in different cases
  • 3. confirm word publishing is not initiated by pressing Enter from the keyboard if there are non-alphabetical symbols in the input
  • 4. confirm word publishing is not initiated by pressing the send button if there are non-alphabetical symbols in the input
  • 5. confirm word publishing is not initiated by pressing Enter from the keyboard if there are less than 3 letters in the input
  • 6. confirm word publishing is not initiated by pressing the send button if there are less than 3 letters in the input

5. Letters highlighting

This is the most complicated part to test. Essentially there are two ways to input letters: with the generated set of letters, and with the input directly. Both should lead to the button highlighting or unhighlighting given respective letter was generated for this round. Moreover, highlighted button should be strictly bind to the respective letter in the input meaning that if that letter is removed from the input, the button should be unhighlighted.

  • 1. confirm pressing unhighlighted button leads to its highlighting and addition of the respective letter to the end of the, if there are less than 16 symbols, in the following cases:
    • 1. when the cursor is at the end of the word
    • 2. when the cursor is not at the end of the word
  • 2. confirm pressing unhighlighted button does not lead to its highlighting and addition of the respective letter to the end of the input if there are already 16 symbols in the input
  • 3. confirm typing letter in the input highlights the respective letter button in the following cases:
    • 1. when the letter is typed at the end of the word
    • 2. when the letter is typed in the beginning of the word
  • 4. confirm typing letter in the input for which there is no respective button does not lead to new highlights
  • 5. confirm pasting several letters in the input highlights only respective buttons (i.e. there should be both existing and non-existing letters in the buffer) in the following cases:
    • 1. when the letters are pasted at the end of the word
    • 2. when the letters are pasted in the middle of the word
    • 3. when the letters are pasted in the beginning of the word
  • 6. confirm removing the non-repetitive letter form the input unhighlights the respective button in the following cases:
    • 1. when the letter is at the end of the word
    • 2. when the letter is in the middle of the word
    • 3. when the letter is in the beginning of the word
    • 4. when the letter is cut from the middle of the word
  • 7. confirm typing repetitive letter one time more than it is met in the generated set of letters does not lead to highlighting of a new letter; after that confirm removing the first of such repetitive letters from the input does not lead to unhighlights
  • 8. confirm selecting a few symbols in the input and pasting from the buffer results in the correct (un)highlighting
  • 9. confirm selecting a few symbols and changing their position by dragging & dropping yields exactly the same highlighting as before
  • 10. confirm pressing Enter clears the input and unhighlights the letter buttons

6. Replay

After the replay button is pressed, the tests need to confirm that:

  • 1. a new field (differing from the old one) is generated (and none of the generated buttons are highlighted)
  • 2. the set of published words is reset
  • 3. results are reset
  • 4. network disclaimer is hidden
  • 5. input is cleared
  • 6. timer is reset to its original value
  • 7. all of the previous tests are still passing for the new round
@queleok queleok self-assigned this Aug 21, 2021
queleok added a commit that referenced this issue Aug 21, 2021
@queleok
Copy link
Owner Author

queleok commented Aug 22, 2021

Couldn't find how to mock timers with puppeteer non-intrusively, so I had to make an intrusive change to support some speedup

queleok added a commit that referenced this issue Aug 22, 2021
queleok added a commit that referenced this issue Aug 28, 2021
queleok added a commit that referenced this issue Aug 28, 2021
…possibility of having recoverable failures
queleok added a commit that referenced this issue Aug 28, 2021
…, added test covering most of the 5 section from the #56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant