Commit Graph

77 Commits

Author SHA1 Message Date
Rishabh
25c530293f Added playwright tests for forever and multiple month offers
- adds test that cover creating and signing up to multiple-month/forever offers
- checks that the offer information is shown to members during signup and in account detail
2022-12-14 17:13:20 +05:30
Rishabh
199d8644a5 Fixed offers playwright test for one-time discount
refs aa693039a3

- one-time offer discounts are no longer shown to member in Portal settings, as portal shows only the next payment info.
2022-12-14 16:27:01 +05:30
Rishabh
aa693039a3 🐛 Removed expired offers shown in portal account detail
closes https://github.com/TryGhost/Team/issues/2376#event-8026429598

- if an offer is expired/in past, we no longer show it in member account info against the price
- one-time offers are never showed in portal in member account detail, as the payment information shown to member in Portal points to charge at next payment
- if trial days are over for a subscription, portal doesn't show any offer data on member account detail
2022-12-14 15:27:49 +05:30
Elena Baidakova
7ef157b17f
Improved count of items in e2e tests (#15986)
refs TryGhost/Team#2371
- We need to wait selectors before count them
https://github.com/microsoft/playwright/issues/14278

These changes needed to make the results of tests more stable on the CI
2022-12-12 16:51:31 +04:00
Rishabh
4e766e2584 Fixed broken playwright tests
refs https://github.com/TryGhost/Team/issues/2371

- playwright tests were broken due to state changes based on prev tests that were not accounted for
- in case of multiple newsletters, portal tests expected another step between stripe checkout for newsletter selection
- site settings test was disabling members, but not re-enabling it back
2022-12-12 14:50:34 +05:30
Elena Baidakova
88b056dc86
Added Playwright member's actions tests (#15968)
refs TryGhost/Team#2371
- check that members can unsubscribe from newsletters by toggling
preferences in their account settings
- check that member can log out
2022-12-12 10:13:08 +04:00
Rishabh Garg
109bce8096
Fixed portal comp upgrade playwright tests (#15977)
refs
f5aae1e2c5
refs
0f9ed54a6f

- changing playwright portal tests to work for single tier setup caused failure for comped upgrade tests as they were relying on button text that changed
2022-12-09 19:19:13 +05:30
Peter Zimon
527d718b76
Added extra assertions to Offers tests (#15956)
refs. https://github.com/TryGhost/Team/issues/2371

- two extra assertion was needed for discount and free-trials to check
if the offers are listed in ‘Active’ offers and the URLs load portal
2022-12-09 08:56:41 +01:00
Naz
ffd07ea744
Added Playwright "Private site" test
refs https://github.com/TryGhost/Team/issues/2371

- Test enabling private site and checking access with a password
- The test flow is lacking a check for site access through password
due to a Playwirght bug. This should be cleaned up in the future
2022-12-09 14:01:19 +07:00
Peter Zimon
be84593684 Fixed offers archive test
refs. https://github.com/TryGhost/Team/issues/2371

- deleteAllMembers was an unnecessary step
- since there's a generated code appended to the name of the archived offer, it had to be shorter to avoid potential naming conflicts
2022-12-09 07:48:24 +01:00
Ronald Langeveld
d62f09c588 Added filtered list labelling playwright test
ref https://github.com/TryGhost/Team/issues/2371

- Filters and then adds label to filtered members
2022-12-09 12:56:34 +07:00
Simon Backx
e7572fc111 Added Playwright test for disabled subscription access
refs https://github.com/TryGhost/Team/issues/2371

Portal should be disabled on the frontend, sending as a newsletter should no longer be an option when publishing
2022-12-08 17:58:03 +01:00
Djordje Vlaisavljevic
82aa9522dc Added playwright test for updating atier
refs TryGhost/Team#2371

- Tests that tier details can be updated
- Tests that the updates are reflected in Portal
2022-12-08 17:40:42 +01:00
Simon Backx
6af149120a Added Playwright test for invite only sites
refs https://github.com/TryGhost/Team/issues/2371

Tests if an invite only site disables sign up.
2022-12-08 17:27:30 +01:00
Rishabh
f5aae1e2c5 Updated playwright tests for portal member upgrade
refs https://github.com/TryGhost/Team/issues/2371

- updated setup to ensure single tier for testing single tier flows
- updated portal test to use utils and new data test ids
2022-12-08 21:09:19 +05:30
Simon Backx
08206f367f Removed publishing spec only test 2022-12-08 15:30:27 +01:00
Simon Backx
7c6e9c6ecf Added Playwright tests for scheduled post emails
refs https://github.com/TryGhost/Team/issues/2371

- Added some more utility methods to the Publishing spec
- Added tests for scheduled pusblish+send and send flows
2022-12-08 15:24:37 +01:00
Kevin Ansfield
f2e1d77a0f Fixed linter error 2022-12-08 14:02:27 +00:00
Simon Backx
80258cd396 Added Playwright tests for publishing post with email
refs https://github.com/TryGhost/Team/issues/2371

- Adds a test for publishing and sending
- Adds a test for email only sending
- Updated some util methods in the publishing spec to remove the dependency on the post bookmark (which is not present for email only posts)
2022-12-08 14:38:12 +01:00
Sam Lord
3449c49c10 Tidy up the mocking utility for Mailgun
no issue
Moved the mocking into the Playwright specific codebase, since this will only be used in browser based testing
2022-12-08 13:01:35 +00:00
Sam Lord
249802d62b Added mailgun mock to allow publishing workflow to run
no issue
2022-12-08 13:01:35 +00:00
Naz
4c6a86eca4 Added mocked Mailgun client to browser test env
refs https://github.com/TryGhost/Ghost/pull/15959

- To be able to test and intercept emails we need a mock in test environment - avoids making calls to the Mailgun API
2022-12-08 13:01:35 +00:00
Sodbileg Gansukh
3d6753a54a Added create comped member test
refs https://github.com/TryGhost/Team/issues/2371

A member can be granted a comp in admin, that account should be able to access paid content.
2022-12-08 20:59:12 +08:00
Fabien "egg" O'Carroll
0f9ed54a6f Tested upgrading to a paid subscription from comped
refs https://github.com/TryGhost/Team/issues/2371

Note that the "Choose" button is "Continue" when running this test
standalone so currently it needs to run with the full suite.
2022-12-08 19:54:56 +07:00
Kevin Ansfield
88c8bf7dbc Added compedPlan option to createMember test util
refs https://github.com/TryGhost/Team/issues/2371

Usage:

```
await createTier(page, {name: 'Silver', monthlyPrice: 5, yearlyPrice: 50});
await createMember(page, {email: 'silver@example.com', compedPlan: 'Silver'});
```
2022-12-08 12:17:31 +00:00
Kevin Ansfield
1f22edb47c Removed errant page.pause() 2022-12-08 12:09:54 +00:00
Kevin Ansfield
4eeaca7ab8 Extracted openPostSettingsMenu and setPostVisibility test utils
refs https://github.com/TryGhost/Team/issues/2371

- extracting the re-used actions to utils allows tests to be self-descriptive rather than relying on comments and keeps the selectors and related actions in one place to help refactoring if/when they change
2022-12-08 12:02:22 +00:00
James Morris
e44f10bc5d Updated Playwright test: Sign up for paid plan via portal - single tier
refs https://github.com/TryGhost/Team/issues/2371

- Includes new data-test-* attributes
- Includes better checking of paid tier from member
2022-12-08 11:54:32 +00:00
Kevin Ansfield
9d434b8105 Removed errant page.pause() 2022-12-08 11:27:47 +00:00
Peter Zimon
8e9245bb91 Added archive offers test
refs. https://github.com/TryGhost/Team/issues/2371

- Test for archived offers should be moved to ‘Archived’ view of the offer list in Admin, and the offer URL should redirect to the site's homepage for logged out visitors
2022-12-08 12:21:52 +01:00
Kevin Ansfield
df72182e2d
Further attempt to fix update-published-post test in CI (#15964)
refs https://github.com/TryGhost/Team/issues/2371

- bumped timeout between saving and refreshing to account for slower
speeds in CI
- increased specificity for the frontend text comparisons so the output
when failing is smaller and easier to parse
2022-12-08 10:36:33 +00:00
James Morris
991b60a342 Added the Playwright test: Sign up for paid plan via portal - single tier 2022-12-08 10:23:35 +00:00
Simon Backx
641364876c Added Playwright test to unschedule a post
refs https://github.com/TryGhost/Team/issues/2371

- Schedule and unschedule a post
- Also includes some extra status checks
2022-12-08 11:13:54 +01:00
Rishabh
ae3d85d2c4 Added playwright test for paid member switching plans
refs https://github.com/TryGhost/Team/issues/2371

- tests that a paid member can switch between monthly and yearly plans after logging in
2022-12-08 15:35:41 +05:30
Kevin Ansfield
7371addbc5 Another attempt to fix update-published-post test in CI
refs https://github.com/TryGhost/Team/issues/2371

- the 100ms timeout was enough for local tests to pass but was still failing on CI
- bumped to 200ms and skipped the creation of a new paragraph to reduce what the editor is doing
2022-12-08 09:59:20 +00:00
Kevin Ansfield
8ddf1f0215 Fixed update-published-post Playwright test
refs https://github.com/TryGhost/Team/issues/2371

- added timeout between clicking the editor and starting to type otherwise some of the typing events could be missed causing a mismatch in actual vs expected output
2022-12-08 09:39:05 +00:00
Ronald Langeveld
3e62764a64 Added csv validation, members export Playwright test
ref https://github.com/TryGhost/Team/issues/2371

- updated Member exports with csv validation
- added member fixtures to be loaded into Ghost to ensure filtering
  works correctly when downloading / exporting members csv.
2022-12-08 16:33:27 +07:00
Simon Backx
c1fc0d8888 Added Playwright test to schedule a Page
refs https://github.com/TryGhost/Team/issues/2371

Schedule a page and check if it is only published at the scheduled time.
2022-12-08 10:25:30 +01:00
Simon Backx
0dbc10a41a Added Playwright test for publishing a page
refs https://github.com/TryGhost/Team/issues/2371

Publish a page and verify that the page is published.
2022-12-08 10:24:35 +01:00
Naz
739bda9bb8
Fixed publishing type selectors in playwright
refs https://github.com/TryGhost/Team/issues/2371

- The "data-test-*" selectors in playwright did not work with publishing channel selectors. This is a quick hack to enable working around it
2022-12-08 14:38:59 +07:00
Ronald Langeveld
9a99b81ea4 Added Playwright test for filtered members export
ref https://github.com/TryGhost/Team/issues/2371

- Added test for exporting a set of filtered members
2022-12-08 13:20:29 +07:00
Ronald Langeveld
7567997dbf Added Playwright test for member exports
ref https://github.com/TryGhost/Team/issues/2371

- Tests whether a CSV can be exported with all members
2022-12-08 12:27:41 +07:00
Sanne de Vries
0ebb3cbefe Added Playwright "Post visibility" tests
Refs https://github.com/TryGhost/Team/issues/2371

- Tests whether the post access selection of public, members, or paid-members matches the expected post visibility on the frontend.
2022-12-08 11:26:44 +07:00
Kevin Ansfield
460b031969 Added additional post setting changes to e2e published post update test
refs https://github.com/TryGhost/Team/issues/2371

- tests both the post body and settings in the PSM take effect when saving
2022-12-07 18:18:48 +00:00
Rishabh
e24a67b882 Fixed member upgrade portal playwright test
refs b6db85a5d6

- portal upgrade test used duplicate email which caused the member creation to fail
- also updates the tier selection for checkout
2022-12-07 22:45:12 +05:30
Simon Backx
b615c9f7d2
Added post scheduling Playwright test and loosened time restrictions (#15960)
refs https://github.com/TryGhost/Team/issues/2371

- Adds a test that schedules a post 5 seconds in the future and waits
for it to be published
- Reduced the time restrictions for scheduling: 
    - The minimum time in the frontend is now 5 seconds in the future (came
from 5 minutes in the future)
    - The time picker now suggests 10 minutes in the future instead of the
minimum scheduling time (came from 5 minutes)
    - In the backend, a post will be allowed to be scheduled if it is at
least 2 minutes in the past (came from 2 minutes in the future)
    - The scheduler will publish a post if it is at least 5 minutes in the
past, and maximum 5 minutes in the future (came from 2 minutes)
2022-12-07 17:29:36 +01:00
Djordje Vlaisavljevic
2464d45b4a Added playwright test for creating additional tier
refs TryGhost/Team#2371

- Tests that an additional tier can be created and that it'll appear in portal settings unselected by default
2022-12-07 17:26:11 +01:00
Rishabh Garg
b6db85a5d6
Added playwright test for free member upgrade via portal (#15961)
refs https://github.com/TryGhost/Team/issues/2371

- tests that a free member can upgrade to a paid tier via stripe checkout and the payment details are reflected in portal and member detail page on admin
2022-12-07 21:41:55 +05:30
Hannah Wolfe
205664f75f
Updated Playwright createTier util to be repeatable
- we have to close the premium tier list after creating a tier, else we can't create another one
2022-12-07 14:32:26 +00:00
Kevin Ansfield
3bd9e2ecfe
Added Playwright "Update published post" test (#15958)
refs https://github.com/TryGhost/Team/issues/2371

- tests modifying the content of a published post
- extracted publish flow into a `publishPost` function that returns a new browser page object with the newly created post loaded
2022-12-07 14:13:23 +00:00