Skip to content

Commit dc91a1e

Browse files
Merge branch 'main' into lang
2 parents 402dcca + 5a0722f commit dc91a1e

15 files changed

Lines changed: 19643 additions & 197 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Emulator Step'
2+
description: 'Run Android emulator with common configuration.'
3+
inputs:
4+
api-level:
5+
description: 'API level for the emulator.'
6+
required: true
7+
script:
8+
description: 'Script to run inside the emulator.'
9+
required: true
10+
runs:
11+
using: 'composite'
12+
steps:
13+
- uses: reactivecircus/android-emulator-runner@v2
14+
with:
15+
api-level: ${{ inputs.api-level }}
16+
arch: x86_64
17+
profile: medium_phone
18+
force-avd-creation: false
19+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
20+
disable-animations: true
21+
script: ${{ inputs.script }}
22+

.github/workflows/android-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
paths-ignore:
66
- '**/*.md'
7-
- '.github/workflows/android-test-ci.yml'
87
- '.github/workflows/android-emulator-test.yml'
98
- '.github/workflows/codeql-analysis.yml'
109
- '.github/workflows/close-empty-xml.yml'
@@ -13,7 +12,6 @@ on:
1312
pull_request:
1413
paths-ignore:
1514
- '**/*.md'
16-
- '.github/workflows/android-test-ci.yml'
1715
- '.github/workflows/android-emulator-test.yml'
1816
- '.github/workflows/codeql-analysis.yml'
1917
- '.github/workflows/close-empty-xml.yml'

.github/workflows/android-emulator-test.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
api-level: [29, 31, 35]
18+
api-level: [35]
1919
steps:
2020
- uses: actions/checkout@v4
2121
- uses: ./.github/actions/common-setup
@@ -36,24 +36,16 @@ jobs:
3636
key: avd-${{ matrix.api-level }}
3737
- name: Create AVD and generate snapshot for caching
3838
if: steps.avd-cache.outputs.cache-hit != 'true'
39-
uses: reactivecircus/android-emulator-runner@v2
39+
uses: ./.github/actions/emulator-step
4040
with:
4141
api-level: ${{ matrix.api-level }}
42-
arch: x86_64
43-
force-avd-creation: false
44-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
45-
disable-animations: true
4642
script: echo "Generated AVD snapshot for caching."
4743
- name: Build app and test APKs
4844
run: ./gradlew assembleDebug assembleDebugAndroidTest
4945
- name: Run instrumented tests
50-
uses: reactivecircus/android-emulator-runner@v2
46+
uses: ./.github/actions/emulator-step
5147
with:
5248
api-level: ${{ matrix.api-level }}
53-
arch: x86_64
54-
force-avd-creation: false
55-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
56-
disable-animations: true
5749
script: ./gradlew connectedDebugAndroidTest -x assembleDebug -x assembleDebugAndroidTest
5850
- name: Upload test results
5951
uses: actions/upload-artifact@v4

.github/workflows/android-test-ci.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ WiFiAnalyzer is licensed under the GNU General Public License v3.0 (GPLv3).
9696
## WiFiAnalyzer Build
9797

9898
[![Workflow Status](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/workflows/Android%20CI/badge.svg)](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/actions?query=workflow%3A%22Android+CI%22)
99-
[![Workflow Status](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/workflows/Android%20Instrumentation%20Tests/badge.svg)](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/actions?query=workflow%3A%22Android+Instrumentation+Tests%22)
99+
[![Workflow Status](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/workflows/Android%20Emulator%20Tests/badge.svg)](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/actions?query=workflow%3A%22Android+Emulator+Tests%22)
100100
[![Workflow Status](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/workflows/CodeQL%20Analyze/badge.svg)](https://github.com/VREMSoftwareDevelopment/WiFiAnalyzer/actions?query=workflow%3A%22CodeQL+Analyze%22)
101101

102102
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/203eaa0583694bcca6554190513179ba)](https://app.codacy.com/gh/VREMSoftwareDevelopment/WiFiAnalyzer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
@@ -167,7 +167,7 @@ This project uses GitHub Actions for CI/CD. On every push and pull request, the
167167
- Lint analysis
168168
- Unit tests with coverage (uploaded to Codecov)
169169
- APK build (debug)
170-
- Instrumented tests on Android emulator (API levels 29, 31, 35)
170+
- Instrumented tests on Android emulator
171171
- Artifacts (reports and APK) are available for download in the workflow run
172172

173173
## Translation

app/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Build Properties
2-
#Thu Dec 25 14:35:02 EST 2025
3-
version_build=38
2+
#Mon Dec 29 11:24:27 EST 2025
3+
version_build=40
44
version_major=3
55
version_minor=2
66
version_patch=1

app/src/androidTest/kotlin/com/vrem/wifianalyzer/ChannelAvailableInstrumentedTest.kt

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,13 @@ import org.hamcrest.Matchers.allOf
2727
internal class ChannelAvailableInstrumentedTest : Runnable {
2828
override fun run() {
2929
selectMenuItem(7, "Available Channels")
30-
verify2GHzSection()
31-
verify5GHzSection()
32-
verify6GHzSection()
30+
verifySections()
3331
pressBack()
3432
}
3533

36-
private fun verify2GHzSection() {
37-
onView(allOf(withText("2.4 GHz"), isDisplayed())).check(matches(isDisplayed()))
38-
}
39-
40-
private fun verify5GHzSection() {
41-
onView(allOf(withText("5 GHz"), isDisplayed())).check(matches(isDisplayed()))
42-
}
43-
44-
private fun verify6GHzSection() {
45-
onView(allOf(withText("6 GHz"), isDisplayed())).check(matches(isDisplayed()))
34+
private fun verifySections() {
35+
listOf("2.4 GHz", "5 GHz", "6 GHz").forEach { section ->
36+
onView(allOf(withText(section), isDisplayed())).check(matches(isDisplayed()))
37+
}
4638
}
4739
}

app/src/androidTest/kotlin/com/vrem/wifianalyzer/InstrumentedTestUtils.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.view.MotionEvent
2222
import android.view.View
2323
import android.view.ViewGroup
2424
import androidx.appcompat.widget.Toolbar
25+
import androidx.recyclerview.widget.RecyclerView
2526
import androidx.test.espresso.Espresso.onView
2627
import androidx.test.espresso.ViewAction
2728
import androidx.test.espresso.action.GeneralClickAction
@@ -30,7 +31,9 @@ import androidx.test.espresso.action.Tap
3031
import androidx.test.espresso.action.ViewActions.click
3132
import androidx.test.espresso.assertion.ViewAssertions.doesNotExist
3233
import androidx.test.espresso.assertion.ViewAssertions.matches
34+
import androidx.test.espresso.contrib.RecyclerViewActions
3335
import androidx.test.espresso.matcher.BoundedMatcher
36+
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
3437
import androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom
3538
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
3639
import androidx.test.espresso.matcher.ViewMatchers.withClassName
@@ -155,3 +158,12 @@ internal fun selectMenuItem(
155158

156159
onView(isAssignableFrom(Toolbar::class.java)).check(matches(withToolbarTitle(expectedTitle)))
157160
}
161+
162+
internal fun scrollToAndVerify(
163+
text: String,
164+
recyclerViewId: Int = androidx.preference.R.id.recycler_view,
165+
) {
166+
onView(withId(recyclerViewId))
167+
.perform(RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(hasDescendant(withText(text))))
168+
onView(withText(text)).check(matches(isDisplayed()))
169+
}

app/src/androidTest/kotlin/com/vrem/wifianalyzer/SettingsInstrumentedTest.kt

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,30 @@
1717
*/
1818
package com.vrem.wifianalyzer
1919

20-
import androidx.recyclerview.widget.RecyclerView
21-
import androidx.test.espresso.Espresso.onView
2220
import androidx.test.espresso.Espresso.pressBack
23-
import androidx.test.espresso.assertion.ViewAssertions.matches
24-
import androidx.test.espresso.contrib.RecyclerViewActions
25-
import androidx.test.espresso.matcher.ViewMatchers.hasDescendant
26-
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
27-
import androidx.test.espresso.matcher.ViewMatchers.withId
28-
import androidx.test.espresso.matcher.ViewMatchers.withText
2921

3022
internal class SettingsInstrumentedTest : Runnable {
3123
override fun run() {
3224
selectMenuItem(10, "Settings")
33-
verifyVisibleSettings()
34-
verifyScrollableSettings()
25+
verifySettings()
3526
pressBack()
3627
}
3728

38-
private fun verifyVisibleSettings() {
39-
onView(withText("Scan Interval")).check(matches(isDisplayed()))
40-
onView(withText("Sort Access Points By")).check(matches(isDisplayed()))
41-
onView(withText("Group Access Points By")).check(matches(isDisplayed()))
42-
onView(withText("Connection Display")).check(matches(isDisplayed()))
43-
onView(withText("Access Point Display")).check(matches(isDisplayed()))
44-
onView(withText("Graph Maximum Signal Strength")).check(matches(isDisplayed()))
45-
onView(withText("Channel Graph Legend Display")).check(matches(isDisplayed()))
46-
onView(withText("Time Graph Legend Display")).check(matches(isDisplayed()))
47-
}
48-
49-
private fun verifyScrollableSettings() {
50-
scrollToAndVerify("Theme")
51-
scrollToAndVerify("Keep screen on")
52-
scrollToAndVerify("Country")
53-
scrollToAndVerify("Language")
54-
scrollToAndVerify("Reset")
55-
}
56-
57-
private fun scrollToAndVerify(text: String) {
58-
onView(withId(androidx.preference.R.id.recycler_view))
59-
.perform(RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>(hasDescendant(withText(text))))
60-
onView(withText(text)).check(matches(isDisplayed()))
29+
private fun verifySettings() {
30+
listOf(
31+
"Scan Interval",
32+
"Sort Access Points By",
33+
"Group Access Points By",
34+
"Connection Display",
35+
"Access Point Display",
36+
"Graph Maximum Signal Strength",
37+
"Channel Graph Legend Display",
38+
"Time Graph Legend Display",
39+
"Theme",
40+
"Keep screen on",
41+
"Country",
42+
"Language",
43+
"Reset",
44+
).forEach { scrollToAndVerify(it) }
6145
}
6246
}

app/src/main/kotlin/com/vrem/util/FileUtils.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package com.vrem.util
1919

2020
import android.content.res.Resources
2121
import androidx.annotation.RawRes
22-
import java.util.zip.ZipInputStream
2322

2423
fun readFile(
2524
resources: Resources,
@@ -32,16 +31,3 @@ fun readFile(
3231
.use { it.readText() }
3332
.replace("\r", String.EMPTY)
3433
}.getOrDefault(String.EMPTY)
35-
36-
fun readZipFile(
37-
resources: Resources,
38-
@RawRes id: Int,
39-
): List<String> =
40-
runCatching {
41-
resources.openRawResource(id).use { inputStream ->
42-
ZipInputStream(inputStream).use { zipInputStream ->
43-
zipInputStream.nextEntry
44-
zipInputStream.bufferedReader().readLines()
45-
}
46-
}
47-
}.getOrDefault(emptyList())

0 commit comments

Comments
 (0)