Skip to content

CATROID-1477 Fix: WhenBackgroundChangesToBrickTest and Tutorial Handling#5187

Open
harshsomankar123-tech wants to merge 7 commits intoCatrobat:developfrom
harshsomankar123-tech:fix/CATROID-1477-testCreateNewBackground
Open

CATROID-1477 Fix: WhenBackgroundChangesToBrickTest and Tutorial Handling#5187
harshsomankar123-tech wants to merge 7 commits intoCatrobat:developfrom
harshsomankar123-tech:fix/CATROID-1477-testCreateNewBackground

Conversation

@harshsomankar123-tech
Copy link
Copy Markdown
Member

@harshsomankar123-tech harshsomankar123-tech commented Apr 4, 2026

JIRA- TICKET :https://catrobat.atlassian.net/browse/CATROID-1477

Description

This pull request addresses stability issues and flakiness in the WhenBackgroundChangesToBrickTest instrumentation test. It also modernizes the codebase by refactoring the test from Java to Kotlin as requested by the maintainers.

Changes

Kotlin Refactor (New)

  • Language Migration: Converted WhenBackgroundChangesToBrickTest.java to WhenBackgroundChangesToBrickTest.kt to comply with the project's modernization goals.
  • Lint/Detekt Compliance: Added @Suppress("SwallowedException") to the waitOnViewAndClick helper to resolve GitHub Advanced Security warnings while maintaining the necessary retry-loop logic.

Lifecycle Management

  • Moved Intents.init() and Intents.release() to @before and @after methods to guarantee that Espresso-Intents are correctly handled even in the event of a test failure.

PocketPaint Tutorial Handling

  • Implemented logic to detect and click the "skip" button (pocketpaint_btn_skip) upon PocketPaint launch, ensuring the drawing surface is accessible for interaction.

Enhanced Synchronization

  • Wait for Display: Added waitFor(isDisplayed()) for pocketpaint_drawing_surface_view to stabilize transitions.
  • Post-Back Buffer: Introduced a 500ms post-back wait after pressBack() to allow onActivityResult to finish file operations before assertions occur.
  • Explicit Scoping: Changed calls to CustomActions.wait() to be explicit, resolving naming conflicts with the standard Object.wait() in Java/Kotlin.
  • Cleanup: Added logic in the @after method to finish the activity and delete test projects, preventing shared state interference between test runs.

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@harshsomankar123-tech harshsomankar123-tech marked this pull request as draft April 5, 2026 10:28
@harshsomankar123-tech harshsomankar123-tech marked this pull request as ready for review April 5, 2026 10:51
@harshsomankar123-tech harshsomankar123-tech added the Active Member Tickets that are assigned to members that are still currently active label Apr 5, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

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

Labels

Active Member Tickets that are assigned to members that are still currently active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants