Skip to content

Conversation

@irfano
Copy link
Contributor

@irfano irfano commented Nov 20, 2024

Closes: woocommerce/woomobile-private#393

Description

This fixes incorrect file locations for promo texts in screenshots.json. bundle exec fastlane download_promo_strings command downloads promo texts in metadata/android/{locale}/promo_screenshot_5.txt.

Testing information

Follow Android Screenshots instructions (P91TBi-8Pt-p2) to test generating promo screenshots.

The tests that have been performed

Generating promo screenshots with bundle exec fastlane create_promo_screenshot locales:en-US

Images/gif

image

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@irfano irfano added the category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. label Nov 20, 2024
@irfano irfano added this to the 21.2 milestone Nov 20, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 20, 2024

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit595809b
Direct Downloadwoocommerce-wear-prototype-build-pr12965-595809b.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 20, 2024

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit595809b
Direct Downloadwoocommerce-prototype-build-pr12965-595809b.apk

@irfano irfano changed the base branch from trunk to update-ruby-gems November 21, 2024 17:57
@irfano irfano marked this pull request as ready for review November 21, 2024 17:57
@irfano irfano removed this from the 21.2 milestone Nov 21, 2024
Base automatically changed from update-ruby-gems to trunk November 21, 2024 21:12
@irfano irfano force-pushed the fix/generating-promo-screenshots-script branch from d92591f to e8fe491 Compare November 21, 2024 21:29
@irfano irfano changed the base branch from trunk to release/21.2 November 25, 2024 20:04
@irfano irfano added this to the 21.2 ❄️ milestone Nov 25, 2024
@irfano irfano changed the base branch from release/21.2 to trunk November 26, 2024 12:15
@irfano irfano modified the milestones: 21.2 ❄️, 21.3 Nov 26, 2024
@JorgeMucientes JorgeMucientes self-assigned this Nov 27, 2024
@JorgeMucientes
Copy link
Contributor

Hey @irfano code changes look good but I'm unable to run the screenshot command successfully.

I get the following error all the time:

[16:34:05]: Called from Fastfile at line 930
[16:34:05]: ```
[16:34:05]:     928:          UI.error(e)
[16:34:05]:     929:        end
[16:34:05]:  => 930:        screengrab(
[16:34:05]:     931:          screenshot_options.merge(
[16:34:05]:     932:            {
[16:34:05]: ```
[16:34:05]: Tests failed for locale en-US on device emulator-5560

Some screenshot test is broken (although if I run screenshot test from AS they run just fine)

[16:32:38]: ▸ com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest:s_glBindAttribLocation: bind attrib 0 name position
[16:32:38]: ▸ s_glBindAttribLocation: bind attrib 1 name color
[16:32:38]: ▸ s_glBindAttribLocation: bind attrib 2 name localCoord
[16:34:05]: ▸ Error in screenshots(com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest):
[16:34:05]: ▸ java.lang.AssertionError: Unable to continue – expectation wasn't satisfied quickly enough
[16:34:05]: ▸   at org.junit.Assert.fail(Assert.java:89)
[16:34:05]: ▸   at com.woocommerce.android.e2e.helpers.util.TestIdler.idleUntilReady(TestIdler.kt:43)
[16:34:05]: ▸   at com.woocommerce.android.e2e.helpers.util.TestIdler.idleUntilReady(TestIdler.kt:33)
[16:34:05]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.waitForConditionToBeTrue(Screen.kt:475)
[16:34:05]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.waitForElementToBeDisplayed(Screen.kt:404)
[16:34:05]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.<init>(Screen.kt:66)
[16:34:05]: ▸   at com.woocommerce.android.e2e.screens.orders.SingleOrderScreen.<init>(SingleOrderScreen.kt:17)
[16:34:05]: ▸   at com.woocommerce.android.e2e.screens.orders.OrderListScreen.selectOrder(OrderListScreen.kt:19)
[16:34:05]: ▸   at com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest.screenshots(ScreenshotTest.kt:127)
[16:34:05]: ▸ Time: 97.599
[16:34:05]: ▸ There was 1 failure:
[16:34:05]: ▸ 1) screenshots(com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest)
[16:34:05]: ▸ java.lang.AssertionError: Unable to continue – expectation wasn't satisfied quickly enough

The screenShot test flow always gets stuck at the orders screens:

Any idea what could be going on?

Copy link
Contributor

@JorgeMucientes JorgeMucientes left a comment

Choose a reason for hiding this comment

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

Don't want to block these changes because I can't run the screenshots generation on my local environment. So I'm approving 👍🏼

@irfano irfano requested a review from a team as a code owner November 27, 2024 18:08
@irfano irfano force-pushed the fix/generating-promo-screenshots-script branch from 2b44afd to 595809b Compare November 27, 2024 18:19
@irfano
Copy link
Contributor Author

irfano commented Nov 27, 2024

@JorgeMucientes, the issue was caused by today’s date. The changes I made:

  • Order 2201 had a dynamic date of today. I updated it to use a hardcoded date like the others.
  • The date headers were dynamic based on the device’s date. To resolve this, I opened the order using the orderId instead of its position.
    Jorge, your issue should be resolved now.

@irfano irfano merged commit 95ad84b into trunk Nov 27, 2024
15 checks passed
@irfano irfano deleted the fix/generating-promo-screenshots-script branch November 27, 2024 21:42
@JorgeMucientes
Copy link
Contributor

Hey @irfano thanks for making the updates.

Just letting you know that after updating with the latest changes I'm still facing an error while running ScreenshotTests. The error this time seems to be different although is still happening on the order list screen for OrderListScreen.selectOrder:

com.woocommerce.android.test/com.woocommerce.android.WooCommerceTestRunner
[07:58:55]: ▸ com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest:s_glBindAttribLocation: bind attrib 0 name position
[07:58:55]: ▸ s_glBindAttribLocation: bind attrib 1 name color
[07:58:55]: ▸ s_glBindAttribLocation: bind attrib 2 name localCoord
[08:00:30]: ▸ Error in screenshots(com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest):
[08:00:30]: ▸ java.lang.AssertionError: Unable to continue – expectation wasn't satisfied quickly enough
[08:00:30]: ▸   at org.junit.Assert.fail(Assert.java:89)
[08:00:30]: ▸   at com.woocommerce.android.e2e.helpers.util.TestIdler.idleUntilReady(TestIdler.kt:43)
[08:00:30]: ▸   at com.woocommerce.android.e2e.helpers.util.TestIdler.idleUntilReady(TestIdler.kt:33)
[08:00:30]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.waitForConditionToBeTrue(Screen.kt:475)
[08:00:30]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.waitForElementToBeDisplayed(Screen.kt:404)
[08:00:30]: ▸   at com.woocommerce.android.e2e.helpers.util.Screen.<init>(Screen.kt:66)
[08:00:30]: ▸   at com.woocommerce.android.e2e.screens.orders.SingleOrderScreen.<init>(SingleOrderScreen.kt:18)
[08:00:30]: ▸   at com.woocommerce.android.e2e.screens.orders.OrderListScreen.selectOrder(OrderListScreen.kt:19)
[08:00:30]: ▸   at com.woocommerce.android.e2e.tests.screenshot.ScreenshotTest.screenshots(ScreenshotTest.kt:127)

@irfano
Copy link
Contributor Author

irfano commented Nov 28, 2024

Jorge mentioned that it worked on trunk after merging this PR. The issue above might be a temporary problem on his local setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants