Commit Graph

32421 Commits

Author SHA1 Message Date
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
Rishabh
d04048718c Updated portal with data test attributes
refs https://github.com/TryGhost/Team/issues/2371

- bumps portal to latest that includes data test attributes for playwright testing
2022-12-08 16:28:22 +05:30
Rishabh
a71f096905 Released Portal v2.21.0 2022-12-08 16:26:17 +05:30
Rishabh
b3db2d38f7 Added data test attributes for Portal
refs https://github.com/TryGhost/Team/issues/2371

- adds data attributes to portal action buttons/inputs/switches for playwright tests
2022-12-08 16:25:29 +05:30
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
c78a04f54c Increased Sentry maxValueLength to 1000
refs https://ghost.slack.com/archives/C02G9E68C/p1670342388977959

Sentry truncates important information in error messages (e.g. errors with long MySQL queries). Increasing maxValueLength should give us more information for those errors.

Sentry documentation: https://docs.sentry.io/platforms/javascript/configuration/options/#max-value-length
2022-12-08 11:15:52 +01: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
Rishabh
bc9b8a22f0 Added test data attributes to Portal for playwright tests
refs https://github.com/TryGhost/Team/issues/2371

- adds `data-test-*` attributes to portal across pages to allow easily capturing buttons/switches for playwright tests
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
Fabien "egg" O'Carroll
69e080e9a0 Removed filtering in mega
This is no longer necessary as we unsubscribe members from newsletters when
their email is suppressed.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
939e3ce96f Fixed suppression list handling of spam complaint events
refs https://github.com/TryGhost/Team/issues/2351

We were storing all suppressions with a reason of bounced, rather than
spam for spam complaint events.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
5749a17910 Cleaned up EmailEventStorage tests
This ensures that services aren't required before boot, so that they are
initialised in the correct order.
2022-12-08 13:02:36 +07:00
Fabien "egg" O'Carroll
9736d942e1 Unsubscribed Members from newsletters when their email is suppressed
refs https://github.com/TryGhost/Team/issues/2367

This ensures that a Member is not considered subscribed to any emails, so that
counts for newsletter recipients are correct. Eventually we will filter members
on their email suppression status but this is not implemented yet.
2022-12-08 13:02:36 +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
Fabien "egg" O'Carroll
80b766047e Added defaults for monthly and yearly price
refs https://github.com/TryGhost/Team/issues/2362

Rather than throwing when we encounter a Tier price of 0, we can instead default
to the standard yearly and monthly price.
2022-12-07 22:02:37 +07:00
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
Ronald Langeveld
5bd82bc6d7 Added Playwright test for Member Impersonation
ref https://github.com/TryGhost/Team/issues/2371

- tests whether an impersonation link gets generated as well as whether
  the link authenticates the user on a new page.
2022-12-07 19:26:23 +07:00
Simon Backx
31855ba75a Added Playwright publish only test
refs https://github.com/TryGhost/Team/issues/2371

Test publishing flow for publish only posts.
2022-12-07 12:03:56 +01:00
Sam Lord
d6072ea0e8 Record tests using same setup as the test runner
no issue
2022-12-07 10:59:45 +00:00
Ronald Langeveld
8c41807978 Added Playwright test for deleting members from Admin.
ref https://github.com/TryGhost/Team/issues/2371

- This test will delete the previously added and editor member, returning the initial member state with no members.
2022-12-07 17:00:36 +07:00
Daniel Lockyer
1e27dd638f
Added Playwright check that Offer redemption count was incremented
refs https://github.com/TryGhost/Team/issues/2369

- this checks whether the Offer redemption count is set to 1, which
  would be indicative that the Offer was successfully counted as
  redeemed
2022-12-07 16:52:58 +07:00
Daniel Lockyer
464504a8e1
Avoided config.local.json loading in testing-browser environment
- this should be checking if we're in any of the testing envionments and
  avoid loading the `config.local.json` file if so
2022-12-07 16:25:23 +07:00
Ghost CI
e323d6162c Merged v5.25.2 into main 2022-12-07 09:04:25 +00:00
Ghost CI
a014817aa9 v5.25.2 2022-12-07 09:04:22 +00:00