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

Semantic domains tests #1487

Merged
merged 5 commits into from
Sep 30, 2022
Merged

Conversation

JeanneSon
Copy link
Contributor

Description

The following test has been converted to playwright
✓ should be using English Semantic Domain for manager

The other tests had to be combined to one large tests called Can change Project default language to Thai & back and forth as they were all dependent on each other
✓ can change Project default language to Thai
✓ should be using Thai Semantic Domain
✓ can change Project default language back to English
✓ should be using English Semantic Domain
✓ can change Project default language back to Thai
✓ should be using Thai Semantic Domain after refresh
✓ can change user interface language
✓ should still have Thai for Project default language
✓ should be using English Semantic Domain
✓ should be using English Semantic Domain after refresh
✓ should still have Thai for Project default language
✓ can change user interface language to English
✓ can change Project default language to match interface language twice
✓ can change user interface language to back English

For the conversion, a helper function was needed which allows the developer to check the selected option of
a select dropdown. It is located in the file playwright-helpers.ts.

Type of Change

  • E2E test

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 added the testing Pertaining to unit or e2e testing label Sep 27, 2022
@JeanneSon JeanneSon self-assigned this Sep 27, 2022
@github-actions
Copy link

github-actions bot commented Sep 27, 2022

Unit Test Results

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

Results for commit 63ed41d.

♻️ This comment has been updated with latest results.

@alex-larkin alex-larkin added the engineering Tasks which do not directly relate to a user-facing feature or fix label Sep 29, 2022
Copy link
Contributor

@longrunningprocess longrunningprocess left a comment

Choose a reason for hiding this comment

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

that was a lot, nice work!

Two things:

  1. It would be good to rebase develop and make sure the tests are still good before merging, I suspect they would be.
  2. I'm seeing a consistent test failure locally even though they don't seem to be failing when run as part of this PR... not sure if this is a problem or not but it might be good to have one more person run these locally to be sure.

1 failed
[chromium] › semantic-domains.spec.ts:46:3 › Lexicon E2E Semantic Domains Lazy Load › Can change Project default language to Thai & back and forth

Error: expect(received).toHaveText(expected)

- Expected string  - 1
+ Received string  + 3

- ภาษาไทย
+
+         
+         English
Call log:
  - expect.toHaveText with timeout 5000ms
  - waiting for selector "#languageDropdownButton"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"
  -   selector resolved to <a href="" aria-haspopup="true" aria-expanded="fals…>…</a>
  -   unexpected value "
        
        English"


  59 |     await projectSettingsPage.projectTab.saveButton.click();
  60 |     await expectOptionSelectedInSelectElement(projectSettingsPage.projectTab.defaultInterfaceLanguageInput, 'ภาษาไทย');
> 61 |     await expect(pageHeader.languageDropdownButton).toHaveText('ภาษาไทย');
     |                                                     ^
  62 |
  63 |     // should be using Thai semantic domain
  64 |     await editorPage.goto();

test/e2e/utils/playwright-helpers.ts Show resolved Hide resolved
@megahirt
Copy link
Collaborator

All tests pass after rebasing...

JeanneSon and others added 2 commits September 30, 2022 12:22
As in the other cases when another default interface language is
chosen, timeouts make now sure the page has more time to be ready.
@longrunningprocess longrunningprocess merged commit 1c26f2d into develop Sep 30, 2022
@longrunningprocess longrunningprocess deleted the chore/semanticDomainsTests branch September 30, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Tasks which do not directly relate to a user-facing feature or fix testing Pertaining to unit or e2e testing
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants