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

Fix stunReachability test #306

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
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
Expand Up @@ -30,7 +30,7 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.ooni.probe.data.models.SettingsKey
import org.ooni.probe.uitesting.helpers.checkLinkInsideWebView
import org.ooni.probe.uitesting.helpers.checkTextAnywhereInsideWebView
import org.ooni.probe.uitesting.helpers.checkSummaryInsideWebView
import org.ooni.probe.uitesting.helpers.clickOnText
import org.ooni.probe.uitesting.helpers.isNewsMediaScan
Expand Down Expand Up @@ -137,10 +137,7 @@ class RunningTestsTest {
clickOnText(Res.string.Test_Experimental_Fullname)
compose.onAllNodesWithText("stunreachability")[0].performClick()
wait { onNodeWithText(Res.string.measurement).isDisplayed() }
checkLinkInsideWebView(
"https://ooni.org/nettest/http-requests/",
"STUN Reachability",
)
checkTextAnywhereInsideWebView("stunreachability")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,10 @@ fun ComposeTestRule.checkSummaryInsideWebView(text: String) {
}
}

fun ComposeTestRule.checkLinkInsideWebView(
link: String,
text: String,
) {
fun ComposeTestRule.checkTextAnywhereInsideWebView(text: String) {
waitAssertion(WEBSITE_WAIT_TIMEOUT) {
onWebView()
.withElement(findElement(Locator.CSS_SELECTOR, "a[href=\"$link\""))
.withElement(findElement(Locator.CSS_SELECTOR, "*"))
.check(webMatches(getText(), containsString(text)))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ interface OrganizationConfigInterface {
val baseSoftwareName: String

val ooniApiBaseUrl: String
get() = "https://api.ooni.org"
get() = "https://api.dev.ooni.io"

val ooniRunDomain: String
get() = "run.ooni.org"
get() = "run.test.ooni.org"

val ooniRunDashboardUrl: String
get() = "https://run.ooni.org"
get() = "https://run.test.ooni.org"

val explorerUrl: String
get() = "https://explorer.test.ooni.org"
Expand Down