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

Editor entry tests #1408

Merged
merged 17 commits into from
Sep 8, 2022
Merged

Editor entry tests #1408

merged 17 commits into from
Sep 8, 2022

Conversation

JeanneSon
Copy link
Contributor

@JeanneSon JeanneSon commented May 23, 2022

Description

Summary

These tests test

  • functioning of the entries list
  • functioning of the entry editor
    • entries are correct (corresponding to the set-up of the entries)
    • changing the visibility of empty fields
    • uploading and displaying pictures
    • audio (also for different user roles)
    • entries with multiple definitions or meanings
    • creating a new entry
    • configurations of writing system visibility

Details

The following tests have been converted to playwright

Lexicon E2E Editor List and Entry

✓ setup: login, click on test project
✓ browse page has correct word count
✓ search function works correctly
✓ click on first word
✓ edit page has correct word count
✓ word 1: edit page has correct definition, part of speech
✓ add citation form as visible field
✓ citation form field overrides lexeme form in dictionary citation view
✓ one picture and caption is present
✓ file upload drop box is displayed when Add Picture is clicked
✓ audio Input System is present, playable and has "more" control (manager)
✓ word 2: audio Input System is not playable but has "upload" button (manager)
✓ audio Input System is present, playable and has "more" control (member)
✓ word 2: audio Input System is not playable but has "upload" button (member)
✓ audio Input System is playable but does not have "more" control (observer)
✓ word 2: audio Input System is not playable and does not have "upload" button (observer)
✓ can delete audio Input System

✓ word 2: edit page has correct definition, part of speech
✓ dictionary citation reflects example sentences and translations
✓ word with multiple definitions: edit page has correct definitions, parts of speech
✓ word with multiple meanings: edit page has correct example sentences, translations
✓ while Show Hidden Fields has not been clicked, hidden fields are hidden if they are empty
✓ word with multiple meanings: edit page has correct general notes, sources
✓ senses can be reordered and deleted
✓ check that Semantic Domain field is visible (for view settings test later)

For details/remarks regarding converting the above tests, refer to the spreadsheet; https://docs.google.com/spreadsheets/d/1w9wjfm-02QHLhv0ObPAKKlqnDWeag379GIXwOcRU4W0/edit#gid=0

Added
✓ Navigate to other entries with left entry bar

Duplicate / not needed in Playwright and hence dropped
✓ refresh returns to list view
✓ refresh returns to entry view
✓ click on second word (found by definition)
✓ login as member, click on first word
✓ click on second word (found by definition)
✓ login as observer, click on first word
✓ click on second word (found by definition)
✓ login as manager, click on first word
✓ file upload drop box is displayed when Upload is clicked
✓ file upload drop box is not displayed when Cancel Uploading Audio is clicked
✓ click on second word (found by definition)
✓ setup: click on word with multiple definitions (found by lexeme)

These tests were merged with other tests
✓ dictionary citation reflects lexeme form -> Citation form field overrides lexeme form in dictionary citation view
✓ file upload drop box is not displayed when Cancel Adding Picture is clicked -> File upload drop box is displayed when Add Picture is clicked and can be cancelled
✓ change config to show Pictures and hide captions -> Can change config to show pictures and hide empty captions & can change config to show empty captions
✓ caption is hidden when empty if "Hidden if empty" is set in config -> Can change config to show pictures and hide empty captions & can change config to show empty captions
✓ change config to show Pictures and show captions -> Can change config to show pictures and hide empty captions & can change config to show empty captions
✓ when caption is empty, it is visible if "Hidden if empty" is cleared in config -> Can change config to show pictures and hide empty captions & can change config to show empty captions
✓ picture is removed when Delete is clicked -> Picture is removed when Delete is clicked & can change config to hide pictures and hide captions
✓ change config to hide Pictures and hide captions -> Picture is removed when Delete is clicked & can change config to hide pictures and hide captions
✓ while Show Hidden Fields has not been clicked, Pictures field is hidden -> Picture is removed when Delete is clicked & can change config to hide pictures and hide captions
✓ file upload drop box is displayed when Upload is clicked -> File upload drop box is displayed when Upload is clicked & not displayed if upload cancelled
✓ file upload drop box is not displayed when Cancel Uploading Audio is clicked -> File upload drop box is displayed when Upload is clicked & not displayed if upload cancelled
Mock file upload
✓ can't upload a non-audio file -> Can't upload a non-audio file & can upload audio file
✓ can upload an audio file -> Can't upload a non-audio file & can upload audio file
✓ back to browse page, create new word -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ check that word count is still correct -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ modify new word -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ autosaves changes -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ new word is visible in edit page -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
Configuration check
✓ Word has only "th", "tipa" and "taud" visible -> Can change configuration to make a writing system visible or invisible
✓ make "en" input system visible for "Word" field -> Can change configuration to make a writing system visible or invisible
✓ Word has "th", "tipa", "taud" and "en" visible -> Can change configuration to make a writing system visible or invisible
✓ make "en" input system invisible for "Word" field -> Can change configuration to make a writing system visible or invisible
✓ Word has only "th", "tipa" and "taud" visible again -> Can change configuration to make a writing system visible or invisible
✓ make "taud" input system invisible for "Word" field and "tipa" invisible for manager role -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ Word has only "th" visible -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ restore visibility of "taud" for "Word" field -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ Word has only "th" and "taud" visible for manager role -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ restore visibility of "tipa" input system for manager role -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ Word has "th", "tipa" and "taud" visible again for manager role -> Make "taud" input system invisible for "Word" field and "tipa" invisible for manager role, then ensure it worked and change it back
✓ new word is visible in browse page -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ check that word count is still correct in browse page -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ remove new word to restore original word count -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list
✓ previous entry is selected after delete -> Back to browse page, create new word, check word count, modify new word, autosaves changes, new word visible in editor and list

Type of Change

  • E2E test

Screenshots

Checklist

  • I have performed a self-review of my own code
  • I have reviewed the title/description of this PR which will be used as the squashed PR commit message
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works

@JeanneSon JeanneSon self-assigned this May 23, 2022
@github-actions
Copy link

github-actions bot commented May 23, 2022

Unit Test Results

368 tests   368 ✔️  13s ⏱️
    1 suites      0 💤
    1 files        0

Results for commit effc032.

♻️ This comment has been updated with latest results.

@JeanneSon JeanneSon added the testing Pertaining to unit or e2e testing label May 25, 2022
@JeanneSon JeanneSon changed the title Chore/editor entry tests Editor entry tests Jun 28, 2022
rmunn and others added 13 commits September 5, 2022 16:30
Can't use the LexUploadCommands methods after all, as they expect PHP's
special $_FILES array to exist, and user code can't touch that array. So
we copy the guts of those methods into TestControl.php instead.
Usage: add_writing_system_to_project('testlangproj', 'th-Zxxx-x-audio')
We'll use a shared folder instead of trying to handle uploads in PHP
Got the path slightly wrong earlier
The project model was being updated with the user, but the user model
wasn't being updated with the project, resulting in the share dialog
not finding the user as a project member. Fixed now.
The protractor tests test navigation from one entry to another
implicitly. Playwright directly jumps to an entry to test it.
Therefore, an explicite test for navigating from one entry to
another using the side bar on the left was added.
@JeanneSon
Copy link
Contributor Author

I just wanted to mention that the execution of this test file is very slow due to the number of reloads. The only way I could manage to ensure that a page was fully loaded was by including a waitForTimeout. This should be replaced by another solution in the future.

@JeanneSon JeanneSon marked this pull request as ready for review September 6, 2022 14:02
Copy link
Collaborator

@megahirt megahirt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an EPIC PR! Great job @JeanneSon and @rmunn !

@JeanneSon JeanneSon merged commit 11e1709 into develop Sep 8, 2022
@JeanneSon JeanneSon deleted the chore/editorEntryTests branch September 8, 2022 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Pertaining to unit or e2e testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants