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

Remove Applitools #277

Merged
merged 4 commits into from
Jan 29, 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
53 changes: 2 additions & 51 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
- run: cd xcode && bundle exec pod install
- run: bazel build --config=ci -- //:PlayerUI //:PlayerUI-Demo //:PlayerUI_Pod
# TODO: the timeout should be added to the test itself
- run: bazel test --test_env=APPLITOOLS_API_KEY=${APPLITOOLS_API_KEY} --test_env=APPLITOOLS_BATCH_ID=${CIRCLE_SHA1} --test_env=APPLITOOLS_PR_NUMBER=${CIRCLE_PULL_REQUEST##*/} --test_timeout=1200 --jobs=1 --verbose_failures --config=ci -- //:PlayerUI-Unit-Unit //:PlayerUI-UI-ViewInspectorTests //:PlayerUI-UI-XCUITests
- run: bazel test --test_timeout=1200 --jobs=1 --verbose_failures --config=ci -- //:PlayerUI-Unit-Unit //:PlayerUI-UI-ViewInspectorTests //:PlayerUI-UI-XCUITests

- run:
when: always
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
command: |
circle-android wait-for-boot

- run: bazel test --define=APPLITOOLS_API_KEY=${APPLITOOLS_API_KEY} --define=APPLITOOLS_BATCH_ID=${CIRCLE_SHA1} --define=APPLITOOLS_PR_NUMBER=${CIRCLE_PULL_REQUEST##*/} --config=ci -- //android/demo:android_instrumentation_test
- run: bazel test --config=ci -- //android/demo:android_instrumentation_test

- run:
when: always
Expand Down Expand Up @@ -300,20 +300,6 @@ jobs:
steps:
- auto_shipit

applitools_init:
executor: base
steps:
- run:
name: Initialize Applitools
command: curl -L -d '' -X POST "$APPLITOOLS_SERVER_URL/api/externals/github/push?apiKey=$APPLITOOLS_API_KEY&CommitSha=$CIRCLE_SHA1&BranchName=$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$CIRCLE_BRANCH"

applitools_cleanup:
executor: base
steps:
- run:
name: Cleanup Applitools
command: "curl -X POST \"$APPLITOOLS_SERVER_URL/api/externals/github/servers/github.com/commit/$CIRCLE_SHA1/complete?apiKey=$APPLITOOLS_API_KEY\" -H Content-Type:application/json --data '{\"serverId\": \"github.com\", \"commitSha\": \"$CIRCLE_SHA1\"}' -v -L"

workflows:
build_and_test_pr:
jobs:
Expand All @@ -335,16 +321,6 @@ workflows:
requires:
- setup

- applitools_init:
filters:
branches:
ignore:
- /pull\/.*/
context:
- applitools
requires:
- bazelrc

- build:
name: build-trunk
filters:
Expand All @@ -369,10 +345,7 @@ workflows:
branches:
ignore:
- /pull\/.*/
context:
- applitools
requires:
- applitools_init
- bazelrc

- build_ios:
Expand Down Expand Up @@ -419,10 +392,7 @@ workflows:
branches:
ignore:
- /pull\/.*/
context:
- applitools
requires:
- applitools_init
- build-trunk

- android_test:
Expand Down Expand Up @@ -452,17 +422,6 @@ workflows:
requires:
- build-fork

- applitools_cleanup:
filters:
branches:
ignore:
- /pull\/.*/
context:
- applitools
requires:
- android-test-trunk
- build-ios-trunk

build_and_test_main:
when:
equal: [ "", << pipeline.parameters.GHA_Action >> ]
Expand All @@ -479,8 +438,6 @@ workflows:
- setup

- build_ios:
context:
- applitools
requires:
- setup

Expand All @@ -489,8 +446,6 @@ workflows:
- build

- android_test:
context:
- applitools
requires:
- build

Expand Down Expand Up @@ -518,8 +473,6 @@ workflows:
- setup

- build_ios:
context:
- applitools
requires:
- setup

Expand All @@ -528,8 +481,6 @@ workflows:
- build

- android_test:
context:
- applitools
requires:
- build

Expand Down
1 change: 0 additions & 1 deletion PlayerUI.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ and display it as a SwiftUI view comprised of registered assets.
tests.app_host_name = 'PlayerUI/Demo'
tests.dependency 'PlayerUI/InternalUnitTestUtilities'
tests.dependency 'PlayerUI/Demo'
tests.dependency 'EyesXCUI', '8.8.8'
tests.source_files = [
'ios/packages/*/UITests/**/*',
'ios/plugins/*/UITests/**/*'
Expand Down
9 changes: 0 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ overridden_targets = {
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm": "@//android/demo:kotlinx_coroutines_core_jvm_fixed",
}

load("@bazel_tools//tools/build_defs/repo:maven_rules.bzl", "maven_aar")

# Because eyes androidx components is published as type `pom`
maven_aar(
name = "androidx_eyes_components",
artifact = "com.applitools:eyes-android-components-androidx:4.7.6",
settings = "//android/demo:androidsettings.xml",
)

android_ndk_repository(name = "androidndk")

register_toolchains("@androidndk//:all")
Expand Down
28 changes: 0 additions & 28 deletions android/build.bzl

This file was deleted.

8 changes: 1 addition & 7 deletions android/demo/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ load("@build_bazel_rules_android//android:rules.bzl", "android_binary")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_import")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load(":deps.bzl", "main_deps", "test_deps")
load("//android:build.bzl", "applitools_config")
load("@rules_player//kotlin:lint.bzl", "lint")

kt_android_library(
Expand Down Expand Up @@ -52,14 +51,9 @@ java_library(
neverlink = True,
)

applitools_config(
name = "applitools_config",
package = "com.intuit.player.android.reference.demo",
)

kt_android_library(
name = "demo_ui_test",
srcs = glob(["src/androidTest/**/*.kt"]) + [":applitools_config"],
srcs = glob(["src/androidTest/**/*.kt"]),
deps = test_deps + [":demo_lib"],
)

Expand Down
20 changes: 0 additions & 20 deletions android/demo/androidsettings.xml

This file was deleted.

2 changes: 0 additions & 2 deletions android/demo/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ maven_main = [
maven_test = [
"androidx.test.espresso:espresso-intents:%s" % versions.androidx.test.espresso,
"androidx.test.ext:junit-ktx:%s" % versions.androidx.test.junit,
"com.applitools:eyes-android-espresso:%s" % versions.testing.applitools,
]

maven = maven_main + maven_test
Expand All @@ -32,5 +31,4 @@ main_deps = parse_coordinates(maven_main) + [

test_deps = parse_coordinates(maven_test) + [
"//jvm/utils",
"@androidx_eyes_components//aar",
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.rules.activityScenarioRule
import com.intuit.player.android.reference.demo.test.base.ApplitoolsTest
import com.intuit.player.android.reference.demo.test.base.waitForViewInRoot
import com.intuit.player.android.reference.demo.ui.splash.SplashActivity
import com.intuit.player.jvm.utils.makeFlow
Expand All @@ -19,7 +18,7 @@ import org.junit.Test
* If there are new tests added that should be run on device farm,
* update testFilter inclusion list in buildConfig.yml
*/
class SplashActivityTest : ApplitoolsTest() {
class SplashActivityTest {

private val json by lazy {
makeFlow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class ActionUITest : AssetUITest("reference-assets") {
.perform(click())

waitForViewInRoot(withText("Count: ${it + 1}"))

eyes?.checkPlayer("click $it")
}

currentState.shouldBePlayerState<InProgressState> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class InfoUITest : AssetUITest("reference-assets") {
fun verifyView(view: Int) {
waitForViewInRoot(withText("View $view"))
.check(matches(isDisplayed()))

eyes?.checkPlayer("View $view")
}

fun verifyAndProceed(view: Int, action: Action? = null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ class InputUITest : AssetUITest("reference-assets") {
assertEquals(null, dataModel.get("foo.bar"))
}

eyes?.checkPlayer("invalid-input")

onView(withId(R.id.input_field))
.perform(typeText("30"))
.perform(pressImeActionButton())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.junit.Before
import org.junit.Rule
import org.junit.rules.TestName

abstract class AssetUITest(val group: String? = null) : ApplitoolsTest() {
abstract class AssetUITest(val group: String? = null) {

@get:Rule
val name = TestName()
Expand Down Expand Up @@ -40,10 +40,6 @@ abstract class AssetUITest(val group: String? = null) : ApplitoolsTest() {

@After
fun after() {
eyes?.takeIf { it.isOpen }?.run {
checkWindow("done")
close()
}
Intents.release()
}

Expand All @@ -65,8 +61,5 @@ abstract class AssetUITest(val group: String? = null) : ApplitoolsTest() {
playerViewModel = it.currentPlayer?.playerViewModel as? DemoPlayerViewModel
?: throw IllegalStateException("player not found")
}

eyes?.open("Android Reference Assets Demo", "${mock.group}/${mock.name}/${name.methodName}")
eyes?.checkPlayer("init")
}
}
Loading