-
Notifications
You must be signed in to change notification settings - Fork 112
(test) O3-4968: Adding e2e tests for TranslationBuilder component #833
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
base: main
Are you sure you want to change the base?
Conversation
|
Tests are so important. Thank you so much @Bharath-K-Shetty for your continued work on this really important tooling!! |
NethmiRodrigo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close @Bharath-K-Shetty, a few more changes
|
All test workflows works good now. @NethmiRodrigo
|
| await addFormResources(api, valueReference, formUuid); | ||
| }); | ||
|
|
||
| test('Manage translations: switch languages, filter, and search', async ({ page }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steps should go like this,
When I open the language dropdown
Then I should see the language list
And I should see "English (en)" in the language list
When I select the "All" translations tab
Then the "All" translations tab should be selected
When I select the "Translated" translations tab
Then I should see 0 "translated" entries
When I select the "Untranslated" translations tab
Then the "Untranslated" translations tab should be selected
And I should see at least 1 "untranslated" entry
When I search translations for "Visit Details"
Then the translation search input should contain "Visit Details"
And I should see at least 1 translation result
And the first translation result should be visible
| await expect(results).not.toHaveCount(0); | ||
| }); | ||
|
|
||
| await test.step('And the first translation result should be visible', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Shouldn't this include that the translation result should contain the word visit details?
| labelText={t('translationValue', 'Translated Value')} | ||
| value={newValue} | ||
| onChange={(e) => setNewValue(e.target.value)} | ||
| data-testid="translation-value-input" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is the data test id necessary? Can't we target the button from the label text?
| onClick={() => handleEditClick(key)} | ||
| size="md" | ||
| className={styles.deleteButton} | ||
| data-testid="edit-translation-button" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question here about the label

Requirements
Summary
This PR adds comprehensive end-to-end tests for the TranslationBuilder component to ensure proper functionality and user experience across different workflows.
Test Coverage
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-4968
Other