Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CATROID-1594 Fix test 'testNotShowDialogOnCancelledSelection #5012

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2024 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -30,6 +30,7 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.Espresso.pressBack
import androidx.test.espresso.NoActivityResumedException
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
import androidx.test.espresso.intent.Intents
Expand Down Expand Up @@ -138,11 +139,20 @@ class ChromeCastDialogTest {
.perform(click())

Intents.intended(expectedWebIntent)
pressBack()

onView(withText(R.string.cast_searching_for_cast_devices))
.check(doesNotExist())
}

@Test(expected = NoActivityResumedException::class)
fun testNotShowDialogOnCancelledSelectionDoublePressBackCrash() {
onView(withId(R.id.button_add))
.perform(click())
onView(withId(R.id.dialog_new_look_media_library))
.perform(click())
pressBack()
pressBack()
Espresso.closeSoftKeyboard()

onView(withText(R.string.cast_searching_for_cast_devices))
.check(doesNotExist())
}
Expand All @@ -161,4 +171,4 @@ class ChromeCastDialogTest {
Intents.intended(expectedIntent)
Espresso.closeSoftKeyboard()
}
}
}