Skip to content

Paywalls: Add initial snapshot testings for RevenueCatUI library#1432

Merged
tonidero merged 8 commits into
mainfrom
toniricodiez/pwl-176-sdk-add-snapshot-tests-for-templates
Nov 3, 2023
Merged

Paywalls: Add initial snapshot testings for RevenueCatUI library#1432
tonidero merged 8 commits into
mainfrom
toniricodiez/pwl-176-sdk-add-snapshot-tests-for-templates

Conversation

@tonidero

@tonidero tonidero commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

Description

This uses paparazzi to test some basic combination matrix of the different templates settings combinations. Currently testing each template in:

  • Pixel 6
  • Pixel 6 landscape
  • Pixel 6 dark mode
  • Pixel 6 spanish
  • Nexus 7
  • Nexus 10

We might want to refine this list later on.

This is currently working locally, but need to test the CI side and will also need to fix some issues discovered during this first pass. Snapshots in: RevenueCat/purchases-android-snapshots#2

@tonidero tonidero force-pushed the toniricodiez/pwl-176-sdk-add-snapshot-tests-for-templates branch from 81009f2 to f069cc2 Compare November 2, 2023 17:59
@codecov

codecov Bot commented Nov 3, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.27%. Comparing base (f75790a) to head (7d3672c).
Report is 327 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1432   +/-   ##
=======================================
  Coverage   84.27%   84.27%           
=======================================
  Files         197      197           
  Lines        6626     6626           
  Branches      960      960           
=======================================
  Hits         5584     5584           
  Misses        674      674           
  Partials      368      368           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tonidero tonidero marked this pull request as ready for review November 3, 2023 11:53
@tonidero tonidero changed the title [WIP] Paywalls: Add initial snapshot testings for RevenueCatUI library Paywalls: Add initial snapshot testings for RevenueCatUI library Nov 3, 2023
@tonidero tonidero requested a review from a team November 3, 2023 11:53
Comment thread .circleci/config.yml Outdated
Comment thread .circleci/config.yml Outdated
Comment thread .purchases-android-snapshots-commit
}

/**
* Base class for RevenueCat Snapshot tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙏🏻

orientation = ScreenOrientation.LANDSCAPE
)

internal val testConfigs = listOf(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice

Comment on lines +54 to +60
fun templateFullScreen() {
screenshotTest {
InternalPaywall(
options = PaywallOptions.Builder(dismissRequest = {}).build(),
viewModel = MockViewModel(offering = testConfig.offering),
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is very nice. If I did iOS again I'd definitely do it like this.

)

@JvmStatic
@Parameterized.Parameters(name = "{0}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome

@tonidero tonidero force-pushed the toniricodiez/pwl-176-sdk-add-snapshot-tests-for-templates branch from 9518f63 to 7d3672c Compare November 3, 2023 17:10
@tonidero tonidero enabled auto-merge (squash) November 3, 2023 17:10
@tonidero tonidero merged commit 3a1ca22 into main Nov 3, 2023
@tonidero tonidero deleted the toniricodiez/pwl-176-sdk-add-snapshot-tests-for-templates branch November 3, 2023 17:26
NachoSoto pushed a commit that referenced this pull request Nov 6, 2023
**This is an automatic release.**

### New Features
* `StoreProduct`: new `pricePerWeek` and `pricePerYear` (#1426) via
NachoSoto (@NachoSoto)
### RevenueCatUI
* Fix RevenueCatUI API issues and add API tests (#1433) via Toni Rico
(@tonidero)
* Paywalls: Add initial snapshot testings for RevenueCatUI library
(#1432) via Toni Rico (@tonidero)
* `Paywalls`: new `{{ sub_price_per_week }}` variable (#1427) via
NachoSoto (@NachoSoto)
* `Paywalls`: new `{{ sub_relative_discount }}` variable (#1425) via
NachoSoto (@NachoSoto)
### Dependency Updates
* Bump fastlane-plugin-revenuecat_internal from `a297205` to `0ddee10`
(#1431) via dependabot[bot] (@dependabot[bot])
### Other Changes
* `Offering`: restore constructor with no `PaywallData` (#1437) via
NachoSoto (@NachoSoto)

Co-authored-by: revenuecat-ops <ops@revenuecat.com>
@vegaro vegaro added pr:other and removed pr:test labels Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants