Skip to content

Commit

Permalink
Merge pull request #268 from el-qq/fixpathwiki
Browse files Browse the repository at this point in the history
Fix paths to files in wiki
  • Loading branch information
matzuk authored Oct 7, 2021
2 parents c546124 + 8f7a93c commit 4b09959
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion wiki/00_Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Please, be aware of the fact that it's a wiki for the current master. <br>
If you are looking forward of a wiki for old versions then follow links: <br>
[Release 1.0.1](https://github.com/KasperskyLab/Kaspresso/blob/release/1.0.1/wiki/00.%20Home.md) <br>
[Release 1.0.1 support](https://github.com/KasperskyLab/Kaspresso/blob/release/1.0.1/wiki/00.%20Home.md) <br>
[Release 1.1.0](https://github.com/KasperskyLab/Kaspresso/tree/release/1.1.0/wiki/00.%20Home.md) <br>
[Release 1.1.0](https://github.com/KasperskyLab/Kaspresso/blob/release/1.1.0/wiki/00_Home.md) <br>

## Content
[01. Wrapper over Espresso](./01_Wrapper_over_Espresso.md) <br>
Expand Down
2 changes: 1 addition & 1 deletion wiki/02_Wrapper_over_UiAutomator.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class KautomatorMeasureTest : TestCase(
```
It's a great deal!

Also, there are cases when UI Automator can't catch 500ms window. For example, when one element is updating too fast (one update in 100 ms). Just have a look at [this test](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/idlingwait_tests/WaitForIdleTest.kt). Only `KautomatorWaitForIdleSettings.boost()` allows to pass the test.
Also, there are cases when UI Automator can't catch 500ms window. For example, when one element is updating too fast (one update in 100 ms). Just have a look at [this test](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/idlingwait_tests/WaitForIdleTest.kt). Only `KautomatorWaitForIdleSettings.boost()` allows to pass the test.

As you see, we have introduced a special `kautomatorWaitForIdleSettings` property in Kaspresso configurator. By default, this property is **not** boost. Why? Because:
1. You can have tests where you use UI Automator directly. But mentioned timeouts are global parameters. Resetting of these timeouts can lead to an undetermined state.
Expand Down
8 changes: 4 additions & 4 deletions wiki/03_Kaspresso_configurator.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ beforeEachTest(override = true, action = {
```afterEachTest``` is similar to ```beforeEachTest```. <br>
If you set ```override``` in ```false``` then the final beforeAction will be beforeAction of the parent TestCase plus current ```action```. Otherwise, final beforeAction will be only current ```action```.
How it's work and how to override (or just extend) default action, please,
observe the [example](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/configurator_tests/defaultaction_tests).
observe the [example](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/configurator_tests/defaultaction_tests).

#### Device
```Device``` instance. Detailed info is at [Device wiki](./05_Device.md)
Expand All @@ -117,14 +117,14 @@ observe the [example](../samples/kaspresso-sample/src/androidTest/java/com/kaspe

### Kaspresso configuring and Kaspresso interceptors example

The example of how to configure Kaspresso and how to use Kaspresso interceptors is in [here](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/configurator_tests).
The example of how to configure Kaspresso and how to use Kaspresso interceptors is in [here](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/configurator_tests).

### Default Kaspresso settings
```BaseTestCase```, ```TestCase```, ```BaseTestCaseRule```, ```TestCaseRule``` are using default customized **Kaspresso** (```Kaspresso.Builder.simple``` builder). <br>
Most valuable features of default customized **Kaspresso** are below.

#### Logging
Just start [SimpleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/simple_tests/SimpleTest.kt). Next, you will see those logs:
Just start [SimpleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/simple_tests/SimpleTest.kt). Next, you will see those logs:
```
I/KASPRESSO: ---------------------------------------------------------------------------
I/KASPRESSO: BEFORE TEST SECTION
Expand Down Expand Up @@ -215,7 +215,7 @@ What general kinds of flaky errors exist:
1. Common flaky errors that happened because Espresso/UI Automator was in a bad mood =) <br>
That's why Kaspresso wraps **all** actions/assertions of Kakao/Kautomator and handles set of potential flaky exceptions.
If an exception happened then Kaspresso attempts to repeat failed actions/assert for 10 seconds. Such handling rescues developers of any flaky action/assert.<br>
The details are available at [flakysafety](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/flakysafety) and examples are [here](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/flaky_tests).
The details are available at [flakysafety](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/flakysafety) and examples are [here](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/flaky_tests).
2. The reason of a failure is non visibility of a View. In most cases you just need to scroll a parent layout to make the View visible. So, Kaspresso tries to perform it in auto mode. <br>
The details are available at [autoscroll](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/autoscroll).
3. Also, Kaspresso attempts to remove all system dialogs if it prevents the test execution. <br>
Expand Down
16 changes: 8 additions & 8 deletions wiki/04_How_to_write_autotests.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ There are cases when some sentences of steps are absolutely identical and occur
For these sentences we have introduced a ```scenario``` where you can replace your sequences of steps.

How is this API enabled? <br>
Let's look at [SimpleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/simple_tests/SimpleTest.kt) and
[SimpleTestWithRule](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/simple_tests/SimpleTestWithRule.kt). <br>
Let's look at [SimpleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/simple_tests/SimpleTest.kt) and
[SimpleTestWithRule](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/simple_tests/SimpleTestWithRule.kt). <br>
In the first example we inherit ```SimpleTest``` from ```TestCase```. In the second example we use ```TestCaseRule``` field.
Also you can use ```BaseTestCase``` and ```BaseTestCaseRule```. <br>

Expand All @@ -198,7 +198,7 @@ A developer, while he is writing a test, needs to prepare some data for the test
Usually, it's the beginning of the test. <br>
But, first, we want to divide test data preparing and test data usage. Second, we want to guarantee that test data were prepared **before** the test.
That's why we decided to introduce a special DSL to help and to highlight the work with test data preparing. <br>
Please look at the example - [InitTransformDataTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/dsl_tests/InitTransformDataTest.kt). <br>
Please look at the example - [InitTransformDataTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/dsl_tests/InitTransformDataTest.kt). <br>
Updated DSL looks like:
```kotlin
before {
Expand Down Expand Up @@ -254,8 +254,8 @@ Finally, let's look at all available Test DSL in Kaspresso:
7. ```run```

#### Examples
You can have a look at examples of how to [use and configure Kaspresso](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/configurator_tests)
and how to [use different forms of DSL](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/dsl_tests).
You can have a look at examples of how to [use and configure Kaspresso](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/configurator_tests)
and how to [use different forms of DSL](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/dsl_tests).

### Sweet additional features

Expand All @@ -277,7 +277,7 @@ step("Check tv6's text") {
}
}
```
More detailed examples are [here](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/flaky_tests). Please, observe a [documentation](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/flakysafety/FlakySafetyProviderGlobalImpl.kt) about implementation details.
More detailed examples are [here](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/flaky_tests). Please, observe a [documentation](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/flakysafety/FlakySafetyProviderGlobalImpl.kt) about implementation details.

### continuously
This function is similar to what `flakySafely` does, but for negative scenarios, where you need all the time to check that something does not happen.
Expand All @@ -290,7 +290,7 @@ ContinuouslyDialogScreen {
}
}
```
The example is [here](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/continuously_tests).
The example is [here](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/continuously_tests).

### compose
This is a method to make a composed action from multiple actions or assertions, and this action succeeds if at least one of its components succeeds.
Expand Down Expand Up @@ -376,7 +376,7 @@ step("Handle potential unexpected behavior") {
}
}
```
The example is [here](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/compose_tests). <br>
The example is [here](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/compose_tests). <br>
Please, observe additional opportunities and documentation: [common info](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/compose), [ComposeProvider](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/compose/ComposeProvider.kt) and [WebComposeProvider](../kaspresso/src/main/kotlin/com/kaspersky/kaspresso/compose/WebComposeProvider.kt).

#### data
Expand Down
30 changes: 15 additions & 15 deletions wiki/05_Device.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@

### **Structure**

All examples are located in [device_tests](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests).
All examples are located in [device_tests](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests).
**Device** provides these managers:

1. `apps` allows to install or uninstall applications. Uses `adb install` and `adb uninstall` commands. See the example [DeviceAppSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceAppSampleTest.kt).
2. `activities` is an interface to work with currently resumed Activities. AdbServer not required. See the example [DeviceActivitiesSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceActivitiesSampleTest.kt).
3. `files` provides the possibility of pushing or removing files from the device. Uses `adb push` and `adb rm` commands and does not require `android.permission.WRITE_EXTERNAL_STORAGE` permission. See the example [DeviceFilesSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceFilesSampleTest.kt).
4. `internet` allows toggling WiFi and network data transfer settings. Be careful of using this interface, WiFi settings changes could not work with some Android versions. See the example [DeviceNetworkSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceNetworkSampleTest.kt).
5. `keyboard` is an interface to send key events via adb. Use it only when Espresso or UiAutomator are not appropriate (e.g. screen is locked). See the example [DeviceKeyboardSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceKeyboardSampleTest.kt).
6. `location` emulates fake location and allows to toggle GPS setting. See the example [DeviceLocationSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceLocationSampleTest.kt).
7. `phone` allows to emulate incoming calls and receive SMS messages. Works only on emulators since uses `adb emu` commands. See the example [DevicePhoneSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DevicePhoneSampleTest.kt).
8. `screenshots` is an interface screenshots of currently resumed activity. Requires `android.permission.WRITE_EXTERNAL_STORAGE permission`. See the example [DeviceScreenshotSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceScreenshotSampleTest.kt).
9. `accessibility` allows to enable or disable accessibility services. Available since api 24. See the example [DeviceAccessibilitySampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceAccessibilitySampleTest.kt).
10. `permissions` provides the possibility of allowing or denying permission requests via default Android permission dialog. See the example [DevicePermissionsSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DevicePermissionsSampleTest.kt).
11. `hackPermissions` provides the possibility of allowing any permission requests without default Android permission dialog. See the example [DeviceHackPermissionsSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceHackPermissionsSampleTest.kt).
12. `exploit` allows to rotate device or press system buttons. See the example [DeviceExploitSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceExploitSampleTest.kt).
13. `language` allows to switch language. See the example [DeviceLanguageSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceLanguageSampleTest.kt).
14. `logcat` provides access to adb logcat. See the example [DeviceLogcatSampleTest](../samples/kaspresso-sample/src/androidTest/java/com/kaspersky/kaspressample/device_tests/DeviceLogcatSampleTest.kt). <br>
1. `apps` allows to install or uninstall applications. Uses `adb install` and `adb uninstall` commands. See the example [DeviceAppSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceAppSampleTest.kt).
2. `activities` is an interface to work with currently resumed Activities. AdbServer not required. See the example [DeviceActivitiesSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceActivitiesSampleTest.kt).
3. `files` provides the possibility of pushing or removing files from the device. Uses `adb push` and `adb rm` commands and does not require `android.permission.WRITE_EXTERNAL_STORAGE` permission. See the example [DeviceFilesSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceFilesSampleTest.kt).
4. `internet` allows toggling WiFi and network data transfer settings. Be careful of using this interface, WiFi settings changes could not work with some Android versions. See the example [DeviceNetworkSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceNetworkSampleTest.kt).
5. `keyboard` is an interface to send key events via adb. Use it only when Espresso or UiAutomator are not appropriate (e.g. screen is locked). See the example [DeviceKeyboardSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceKeyboardSampleTest.kt).
6. `location` emulates fake location and allows to toggle GPS setting. See the example [DeviceLocationSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceLocationSampleTest.kt).
7. `phone` allows to emulate incoming calls and receive SMS messages. Works only on emulators since uses `adb emu` commands. See the example [DevicePhoneSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DevicePhoneSampleTest.kt).
8. `screenshots` is an interface screenshots of currently resumed activity. Requires `android.permission.WRITE_EXTERNAL_STORAGE permission`. See the example [DeviceScreenshotSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceScreenshotSampleTest.kt).
9. `accessibility` allows to enable or disable accessibility services. Available since api 24. See the example [DeviceAccessibilitySampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceAccessibilitySampleTest.kt).
10. `permissions` provides the possibility of allowing or denying permission requests via default Android permission dialog. See the example [DevicePermissionsSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DevicePermissionsSampleTest.kt).
11. `hackPermissions` provides the possibility of allowing any permission requests without default Android permission dialog. See the example [DeviceHackPermissionsSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceHackPermissionsSampleTest.kt).
12. `exploit` allows to rotate device or press system buttons. See the example [DeviceExploitSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceExploitSampleTest.kt).
13. `language` allows to switch language. See the example [DeviceLanguageSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceLanguageSampleTest.kt).
14. `logcat` provides access to adb logcat. See the example [DeviceLogcatSampleTest](../samples/kaspresso-sample/src/androidTest/kotlin/com/kaspersky/kaspressample/device_tests/DeviceLogcatSampleTest.kt). <br>
The purpose of `logcat`: <br>
If you have not heard about [GDPR](https://gdpr-info.eu/) and [high-profile lawsuits](https://www.theverge.com/2019/1/21/18191591/google-gdpr-fine-50-million-euros-data-consent-cnil) then you are lucky. But, if your application works in Europe then it's so important to enable/disable all analytics/statistics according to acceptance of the agreements.
One of the most reliable ways to check analytics/statistics sending is to verify logcat where all analytics/statistics write their logs (in debug mode, sure).
Expand Down
1 change: 1 addition & 0 deletions wiki/07_DocLoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,4 @@ That's why we changed the primary constructor of [DocLocScreenshotTestCase](../k
But, we've kept the old option of using `DocLocScreenshotTestCase` with old resource providing system as a secondary constructor.
You can view the secondary constructor as an example of migration from old system to new system.
Also, we've retained tests using old resource providing system in samples to ensure that nothing is broken.

0 comments on commit 4b09959

Please sign in to comment.