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
Cleanup allure support sample
eakurnikov committed Sep 26, 2021
commit ea81a241fb53668fdab9bba596463776b9892861
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
package com.kaspersky.kaspresso.alluresupport.sample

import android.Manifest
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import com.kaspersky.components.alluresupport.withAllureSupport
import com.kaspersky.kaspresso.R
import com.kaspersky.kaspresso.alluresupport.sample.screen.MainScreen
import com.kaspersky.kaspresso.kaspresso.Kaspresso
import com.kaspersky.kaspresso.params.ScreenshotParams
import com.kaspersky.kaspresso.params.VideoParams
import com.kaspersky.kaspresso.alluresupport.sample.screen.MainScreen
import com.kaspersky.kaspresso.alluresupport.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

/**
* Use [withAllureSupport] function to add the all available interceptors.
*/
class AllureSupportTest : TestCase(
kaspressoBuilder = Kaspresso.Builder.simple(
customize = {
@@ -23,58 +21,53 @@ 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)
val activityRule = 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()
}
}
fun counter() = run {
step("Launch the app") {
activityRule.launchActivity(null)

MainScreen {
incrementButton.isDisplayed()
decrementButton.isDisplayed()
clearButton.isDisplayed()
valueText.isDisplayed()
}
}

step("Click button_1 and check button_2") {
SimpleScreen {
button1 {
click()
}
button2 {
isVisible()
step("Check increase and decrease buttons") {
step("Increase value up to five") {
MainScreen {
incrementButton {
repeat(5) {
click()
}
}

assertValue(5)
}
}

step("Click button_2 and check edit") {
SimpleScreen {
button2 {
click()
}
edit {
flakySafely(timeoutMs = 7000) { isVisible() }
hasText(R.string.simple_fragment_text_edittext)
step("Decrease value down to three") {
MainScreen {
decrementButton {
repeat(2) {
click()
}
}

assertValue(3)
}
}
}

step("Check all possibilities of edit") {
scenario(
CheckEditScenario()
)
step("Clear the value") {
MainScreen {
clearButton.click()
assertValue(0)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.kaspersky.kaspresso.alluresupport.sample

import android.Manifest
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import com.kaspersky.components.alluresupport.withAllureSupport
import com.kaspersky.kaspresso.R
import com.kaspersky.kaspresso.kaspresso.Kaspresso
import com.kaspersky.kaspresso.testcases.api.testcaserule.TestCaseRule
import com.kaspersky.kaspresso.alluresupport.sample.screen.MainScreen
import com.kaspersky.kaspresso.alluresupport.sample.screen.SimpleScreen
import com.kaspersky.kaspresso_sample_core.MainActivity
import com.kaspersky.kaspresso.params.ScreenshotParams
import com.kaspersky.kaspresso.params.VideoParams
import org.junit.Rule
import org.junit.Test

@@ -23,63 +20,64 @@ import org.junit.Test
*/
class AllureSupportTestWithRule {

@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)

@get:Rule
val testCaseRule = TestCaseRule(
testClassName = javaClass.simpleName,
kaspressoBuilder = Kaspresso.Builder.simple().withAllureSupport()
kaspressoBuilder = Kaspresso.Builder.simple(
customize = {
videoParams = VideoParams(bitRate = 10_000_000)
screenshotParams = ScreenshotParams(quality = 1)
}
).withAllureSupport()
)

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

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

MainScreen {
incrementButton.isDisplayed()
decrementButton.isDisplayed()
clearButton.isDisplayed()
valueText.isDisplayed()
}
}

step("Click button_1 and check button_2") {
SimpleScreen {
button1 {
click()
}
button2 {
isVisible()
step("Check increase and decrease buttons") {
step("Increase value up to five") {
MainScreen {
incrementButton {
repeat(5) {
click()
}
}

assertValue(5)
}
}

step("Click button_2 and check edit") {
SimpleScreen {
button2 {
click()
}
edit {
flakySafely(timeoutMs = 7000) { isVisible() }
hasText(R.string.simple_fragment_text_edittext)
step("Decrease value down to three") {
MainScreen {
decrementButton {
repeat(2) {
click()
}
}

assertValue(3)
}
}
}

step("Check all possibilities of edit") {
scenario(
CheckEditScenario()
)
step("Clear the value") {
MainScreen {
clearButton.click()
assertValue(0)
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.