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

Kaspresso allure support v2 #272

Merged
merged 55 commits into from
Sep 30, 2021
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0cb4807
allure-model module removed
eakurnikov Jun 3, 2021
c5082b8
allure dependencies added to buildSrc
eakurnikov Jun 3, 2021
00dd825
test results files managing refactoring
eakurnikov Jun 3, 2021
f08295e
doc loc tests updated to use new file managers
eakurnikov Jun 3, 2021
d2893a4
old allure reporting interceptors removed
eakurnikov Jun 3, 2021
e5c3c8d
logcat dumping feature added
eakurnikov Jun 3, 2021
66dd1be
custom getStackTraceAsString changed to standard Log.getStackTraceString
eakurnikov Jun 3, 2021
b1e3000
view hierarchy dumping feature added
eakurnikov Jun 3, 2021
fb9e451
screenshot feature updated to use new file managers, screenshot quali…
eakurnikov Jun 3, 2021
4e59f9a
video recording feature added
eakurnikov Jun 3, 2021
105da01
dump logcat and resources dirs managing interceptors added
eakurnikov Jun 3, 2021
a119092
screenshot interceptors updated
eakurnikov Jun 3, 2021
fe9051f
dump view hierarchy interceptor added
eakurnikov Jun 3, 2021
fece8da
video recording interceptor added
eakurnikov Jun 3, 2021
3655172
allure-support module added
eakurnikov Jun 3, 2021
66dab5b
allure supporting interceptors added
eakurnikov Jun 3, 2021
f749e7f
kaspresso test runner and kaspresso builder with allure supporting in…
eakurnikov Jun 3, 2021
e929987
kaspresso sample core module extracted from kaspresso sample
eakurnikov Jun 3, 2021
2af8c2e
kaspresso allure support sample module added
eakurnikov Jun 3, 2021
68a1972
conflicts resolved
eakurnikov Jun 3, 2021
1776442
Merge branch 'master' into kaspresso_allure_support
RuslanMingaliev Jun 15, 2021
b711685
Fix build issues
RuslanMingaliev Jun 15, 2021
85f71a7
Add Kakao, Espresso and Kautomator as transitive dependencies (#260)
RuslanMingaliev Jun 15, 2021
3024a3d
Fix documentation (#261)
sanmiAde Jun 16, 2021
f4534d1
Update tutorial and docs (#262)
RuslanMingaliev Jun 16, 2021
6e3799c
Migrate to new allure version
eakurnikov Sep 25, 2021
edb7300
Remove old allure module
RuslanMingaliev Jul 4, 2021
2e916a5
Sample apps fixes
eakurnikov Sep 25, 2021
47d58fa
Migrate to allure-kotlin
RuslanMingaliev Sep 25, 2021
738d477
Fix kakao imports
eakurnikov Sep 25, 2021
ea7f253
Fix creating files for tests resources
eakurnikov Sep 25, 2021
d796492
Provide uiDevice where possible
eakurnikov Sep 25, 2021
9f991f2
Update allure support sample tests
eakurnikov Sep 25, 2021
e83b4f0
Resources providers impls moved to separated package
eakurnikov Sep 25, 2021
5e5d354
Clear logcat after each dump
eakurnikov Sep 25, 2021
ad455d2
Rename allure support module
eakurnikov Sep 25, 2021
ea297af
Fix detekt
eakurnikov Sep 25, 2021
01c6942
Revert kaspresso-sample-core module extraction
eakurnikov Sep 26, 2021
5a9170a
Fix allure-support sample packages
eakurnikov Sep 26, 2021
1b7a552
Update allure support sample
RuslanMingaliev Sep 26, 2021
ea81a24
Cleanup allure support sample
eakurnikov Sep 26, 2021
b735229
Fix allure kaspresso builder
eakurnikov Sep 26, 2021
35b7b7c
Customize tests added
eakurnikov Sep 26, 2021
1fa96b3
Merge branch 'master' of https://github.com/KasperskyLab/Kaspresso in…
eakurnikov Sep 27, 2021
3c84ddb
Remove gradle.pops
eakurnikov Sep 27, 2021
f9f087e
Update allure support kaspresso builder
eakurnikov Sep 27, 2021
3e3dfb8
Add runtimePermissionRule to allure support tests
eakurnikov Sep 28, 2021
abdf0ae
File packages cleanup and small fixes
eakurnikov Sep 28, 2021
789d38a
Support of old resource providing system in DocLocScreenshotTestCase
matzuk Sep 29, 2021
9e1d6fb
stat analysis fix
matzuk Sep 29, 2021
2da43ed
stat analysis fix
matzuk Sep 29, 2021
01fec54
Fix review
matzuk Sep 30, 2021
456a414
cutom -> custom. fixed misspell
matzuk Sep 30, 2021
56fe3d3
Removed wrong way to split similar resource files (screenshots)
matzuk Sep 30, 2021
365b05d
Merge pull request #5 from eakurnikov/kaspresso_allure_support_docloc
matzuk Sep 30, 2021
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
Prev Previous commit
Next Next commit
kaspresso allure support sample module added
eakurnikov committed Jun 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2af8c2e99727c09bb61f3a5988f179923a3b51a1
56 changes: 56 additions & 0 deletions samples/kaspresso-allure-support-sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import Dependencies.Versions

plugins {
androidApplication
kotlinAndroid
kotlinAndroidExtensions
}

android {
compileSdkVersion(Versions.compileSdk)
buildToolsVersion(Versions.buildTools)

defaultConfig {
applicationId = "com.kaspersky.kaspresso_allure_support_sample"

minSdkVersion(Versions.minSdk)
targetSdkVersion(Versions.targetSdk)

testInstrumentationRunner = "com.kaspersky.components.allure_support.runner.KaspressoTestRunner"
testInstrumentationRunnerArguments = mapOf("clearPackageData" to "true")
}

sourceSets {
val main by getting {
java.srcDir("src/main/kotlin")
}
}

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
}
}

repositories {
maven { url = uri("https://dl.bintray.com/qameta/maven") }
}

dependencies {
implementation(project(mapOf("path" to ":samples:kaspresso-sample-core")))
implementation(Dependencies.appcompat)
implementation(Dependencies.material)
implementation(Dependencies.constraint)

androidTestImplementation(project(Projects.Kaspresso.framework))
androidTestImplementation(project(Projects.Kautomator.framework))
androidTestImplementation(project(Projects.AllureSupport.framework))

androidTestImplementation(Dependencies.runner)
androidTestImplementation(Dependencies.rules)
androidTestImplementation(Dependencies.junit)
androidTestImplementation(Dependencies.espressoCore)
androidTestImplementation(Dependencies.espressoWeb)
androidTestImplementation(Dependencies.kakao)

androidTestUtil(Dependencies.orchestrator)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package com.kaspersky.kaspresso_allure_support_sample

import android.Manifest
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import com.kaspersky.components.allure_support.withAllureSupport
import com.kaspersky.kaspresso_allure_support_sample.screen.MainScreen
import com.kaspersky.kaspresso_allure_support_sample.screen.SimpleScreen
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import com.kaspersky.kaspresso_sample_core.MainActivity
import org.junit.Rule
import org.junit.Test

class AllureSupportTest : TestCase(withAllureSupport()) {

@get:Rule
val runtimePermissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE
)

@get:Rule
val activityTestRule = ActivityTestRule(MainActivity::class.java, true, false)

@Test
fun test() =
run {
step("Open Simple Screen") {
activityTestRule.launchActivity(null)
testLogger.i("I am testLogger")
device.screenshots.take("Additional_screenshot")
MainScreen {
simpleButton {
isVisible()
click()
}
}
}

step("Click button_1 and check button_2") {
SimpleScreen {
button1 {
click()
}
button2 {
isVisible()
}
}
}

step("Click button_2 and check edit") {
SimpleScreen {
button2 {
click()
}
edit {
flakySafely(timeoutMs = 7000) { isVisible() }
hasText(R.string.simple_fragment_text_edittext)
}
}
}

step("Check all possibilities of edit") {
scenario(
CheckEditScenario()
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.kaspersky.kaspresso_allure_support_sample

import com.kaspersky.kaspresso_allure_support_sample.screen.SimpleScreen
import com.kaspersky.kaspresso.testcases.api.scenario.BaseScenario
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext

class CheckEditScenario<ScenarioData> : BaseScenario<ScenarioData>() {

override val steps: TestContext<ScenarioData>.() -> Unit = {

step("Change the text in edit and check it") {
SimpleScreen {
edit {
clearText()
typeText("111")
hasText("111")
}
}
}

step("Change the text in edit and check it. Second check") {
SimpleScreen {
edit {
clearText()
typeText("222")
hasText("222")
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.scroll.KScrollView
import com.agoda.kakao.text.KButton
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.flaky.CommonFlakyActivity
import com.kaspersky.kaspresso.screens.KScreen

object CommonFlakyScreen : KScreen<CommonFlakyScreen>() {

override val layoutId: Int? = R.layout.activity_common_flaky
override val viewClass: Class<*>? = CommonFlakyActivity::class.java

val scrollView = KScrollView { withId(R.id.scroll_view) }

val btn1 = KButton { withId(R.id.scroll_view_btn1) }
val btn3 = KButton { withId(R.id.scroll_view_btn3) }
val btn5 = KButton { withId(R.id.scroll_view_btn5) }

val tv6 = KButton { withId(R.id.scroll_view_tv6) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.text.KButton
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.compose.ComplexComposeSampleActivity
import com.kaspersky.kaspresso.screens.KScreen

object ComplexComposeScreen : KScreen<ComplexComposeScreen>() {

override val layoutId: Int? = R.layout.activity_complex_compose
override val viewClass: Class<*>? = ComplexComposeSampleActivity::class.java

val startButton = KButton { withId(R.id.activity_compose_start) }
val stage1Button = KButton { withId(R.id.activity_compose_stage_1) }
val stage2Button = KButton { withId(R.id.activity_compose_stage_2) }
val finishButton = KButton { withId(R.id.activity_compose_finish) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.text.KTextView
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso.screens.KScreen

object ContinuouslyDialogScreen : KScreen<ContinuouslyDialogScreen>() {
override val layoutId: Int? = null
override val viewClass: Class<*>? = null

val dialogTitle = KTextView {
withText(R.string.continuously_dialog_title)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.text.KButton
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.continuously.ContinuouslySampleActivity
import com.kaspersky.kaspresso.screens.KScreen

object ContinuouslyScreen : KScreen<ContinuouslyScreen>() {
override val layoutId = R.layout.activity_continuously
override val viewClass = ContinuouslySampleActivity::class.java

val startButton = KButton {
withId(R.id.continuously_start_btn)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.edit.KEditText
import com.agoda.kakao.text.KButton
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.device.DeviceSampleActivity
import com.kaspersky.kaspresso.screens.KScreen

object DeviceSampleScreen : KScreen<DeviceSampleScreen>() {

override val layoutId: Int? = R.layout.activity_device_sample
override val viewClass: Class<*>? = DeviceSampleActivity::class.java

val input = KEditText { withId(R.id.input) }

val requestPermissionButton = KButton { withId(R.id.request_permission_button) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.text.KButton
import com.agoda.kakao.text.KTextView
import com.kaspersky.kaspresso_sample_core.MainActivity
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso.screens.KScreen

object MainScreen : KScreen<MainScreen>() {

override val layoutId: Int? = R.layout.activity_main
override val viewClass: Class<*>? = MainActivity::class.java

val simpleButton = KButton { withId(R.id.activity_main_simple_sample_button) }

val webViewButton = KButton { withId(R.id.activity_main_webview_sample_button) }

val flakyButton = KButton { withId(R.id.activity_main_flaky_sample_button) }

val continuouslyButton = KButton { withId(R.id.activity_main_continuously_sample_button) }

val composeButton = KButton { withId(R.id.activity_main_complex_compose_sample_button) }

val idleWaitingButton = KButton { withId(R.id.activity_main_idlewaiting_sample_button) }

val descriptionText = KTextView { withId(R.id.activity_main_title) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.edit.KEditText
import com.agoda.kakao.text.KButton
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.simple.SimpleActivity
import com.kaspersky.kaspresso.screens.KScreen

object SimpleScreen : KScreen<SimpleScreen>() {

override val layoutId: Int? = R.layout.activity_simple
override val viewClass: Class<*>? = SimpleActivity::class.java

val button1 = KButton { withId(R.id.button_1) }

val button2 = KButton { withId(R.id.button_2) }

val edit = KEditText { withId(R.id.edit) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.kaspersky.kaspresso_allure_support_sample.screen

import com.agoda.kakao.web.KWebView
import com.kaspersky.kaspresso_allure_support_sample.R
import com.kaspersky.kaspresso_sample_core.web.WebViewActivity
import com.kaspersky.kaspresso.screens.KScreen

object WebViewScreen : KScreen<WebViewScreen>() {

override val layoutId: Int? = R.layout.activity_webview
override val viewClass: Class<*>? = WebViewActivity::class.java

val webView = KWebView {
withId(R.id.webView)
}
}
Loading