-
Notifications
You must be signed in to change notification settings - Fork 87
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
Multiedit e2e tests #4464
Merged
Merged
Multiedit e2e tests #4464
Changes from 44 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
8107b0e
playwright integration
tomaskikutis ad3628b
make playwright run on the same build to reduce the time required for…
tomaskikutis 0c08b60
implement DB restoring, login, port one test from protractor
tomaskikutis a0b7d34
move e2e test "can create a new user" to playwright
tomaskikutis 9e83b2a
add page object models
tomaskikutis af73abb
move "can apply macro" test to playwright
tomaskikutis 38f884a
improve docs
tomaskikutis 3b94416
Merge branch 'develop' into playwright-integration-to-develop
tomaskikutis 32aa136
don't use legacy database snapshot for playwright tests
tomaskikutis ae1e300
update readme on testing
tomaskikutis 1e9ee8c
fix json
tomaskikutis c6af19a
rename initial dump to main
tomaskikutis 59b18ca
start e2e with admin user logged in already
tomaskikutis 448ace4
fix duplicate declaration after merge
tomaskikutis 2d127a2
add empty main record so full dump can be restored indirectly
tomaskikutis e2b924a
fix desk selection helper
tomaskikutis 67c7054
add missing await
tomaskikutis 07aaae5
update helper to select desk
tomaskikutis a3be574
Merge branch 'develop' into playwright-tests
dzonidoo d4f509c
update e2e dump to have workspace
tomaskikutis c826fd5
Merge remote-tracking branch 'Tomas/update-e2e-dump-to-have-workspace…
dzonidoo f3f71ec
custom workspace part 1
dzonidoo 9609613
use describe in custom
dzonidoo 837c419
personal space part 1
dzonidoo a36f42e
Merge branch 'develop' into playwright-tests
dzonidoo 4cd291f
fix test
dzonidoo 503a708
fix test
dzonidoo 4d55e60
fix tests
dzonidoo f30fd8c
add timeout
tomaskikutis f94ade3
enable linting of playwright tests
tomaskikutis 8f48494
fix an issue with selecting a workspace
tomaskikutis 3b1303c
changes after review part 1
dzonidoo 27a30f8
fix lint
dzonidoo 5ea9cad
improve executeActionOnMonitoringItem helper
tomaskikutis d77802e
improve executeActionOnMonitoringItem helper v2
tomaskikutis c247495
changes after review part 2
dzonidoo fe2074e
improve naming and structure
tomaskikutis 2c4afab
changes after review part 3
dzonidoo 8a4c664
Merge branch 'develop' into playwright-tests
dzonidoo 61e2e39
Merge branch 'develop' into playwright-tests
dzonidoo fadf80c
Merge branch 'develop' into multiedit-e2e-tests
dzonidoo 7f29834
multiedit tests
dzonidoo 63d85f6
Merge branch 'develop' into multiedit-e2e-tests
dzonidoo c3e8399
changes after review
dzonidoo 96d7f83
Merge branch 'develop' into multiedit-e2e-tests
dzonidoo 4431c3c
add selecting a desk in removing article from multiedit vriew test
dzonidoo da919fe
Merge branch 'develop' into multiedit-e2e-tests
dzonidoo f99b519
fix failed tests
dzonidoo 9ba80ce
Merge branch 'develop' into multiedit-e2e-tests
dzonidoo 3c666ae
changes after review
dzonidoo 9a8fa14
improve naming
tomaskikutis 6e7cbf7
move hovering into save fn
tomaskikutis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import {test, expect} from '@playwright/test'; | ||
import {Monitoring} from './page-object-models/monitoring'; | ||
import {restoreDatabaseSnapshot, s} from './utils'; | ||
|
||
test.describe('Multiedit', async () => { | ||
test('Can edit articles in multiedit', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
await page.goto('/#/workspace/monitoring'); | ||
await monitoring.selectDeskOrWorkspace('Sports'); | ||
|
||
await monitoring.executeMultiAction(['test sports story', 'story 2'], 'Multi-edit'); | ||
|
||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story', 'field--headline')) | ||
.getByRole('textbox') | ||
.fill('test sports story 1.1'); | ||
await page.locator(s('multiedit-screen', 'multiedit-article=test sports story')).hover(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story')) | ||
.getByRole('button', {name: 'save'}) | ||
.click(); | ||
|
||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=story 2', 'field--headline')) | ||
.getByRole('textbox') | ||
.fill('story 2.1'); | ||
await page.locator(s('multiedit-screen', 'multiedit-article=story 2')).hover(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=story 2')) | ||
.getByRole('button', {name: 'save'}) | ||
.click(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you create multi-edit helpers file and extract saving there? |
||
|
||
await page.locator(s('multiedit-subnav')).getByRole('button', {name: 'exit'}).click(); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=test sports story 1.1')), | ||
'Edit', | ||
); | ||
await expect( | ||
page.locator(s('authoring', 'field--headline')).getByRole('textbox'), | ||
).toHaveText('test sports story 1.1'); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=story 2.1')), | ||
'Edit', | ||
); | ||
await expect( | ||
page.locator(s('authoring', 'field--headline')).getByRole('textbox'), | ||
).toHaveText('story 2.1'); | ||
}); | ||
|
||
test('Can remove article in multiedit', async ({page}) => { | ||
const monitoring = new Monitoring(page); | ||
|
||
await restoreDatabaseSnapshot(); | ||
await page.goto('/#/workspace/monitoring'); | ||
|
||
await monitoring.executeActionOnMonitoringItem( | ||
page.locator(s('article-item=test sports story')), | ||
'Edit', | ||
); | ||
await monitoring.executeActionInEditor( | ||
'Multiedit', | ||
'OK', | ||
); | ||
|
||
await page.locator(s('multiedit-screen', 'multiedit-article=test sports story')).hover(); | ||
await page | ||
.locator(s('multiedit-screen', 'multiedit-article=test sports story')) | ||
.getByRole('button', {name: 'remove item'}) | ||
.click(); | ||
await expect(page.locator(s('multiedit-screen', 'multiedit-article=test sports story'))).not.toBeVisible(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
scripts/apps/authoring/multiedit/views/sd-multiedit-article.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix test names.