Skip to content

Commit

Permalink
Tune tests
Browse files Browse the repository at this point in the history
  • Loading branch information
max-kammerer committed Feb 5, 2024
1 parent 066dc4e commit b79c3c3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ jobs:
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 170
strategy:
matrix:
arch: [[16, x86], [21, x86], [23, x86], [28, x86], [29, x86_64], [31, x86_64], [32, x86_64], [33, x86_64]]
os: [macos-latest]
runs-on: ${{ matrix.os }}
arch: [[16, x86, ubuntu-latest], [21, x86, ubuntu-latest], [23, x86, ubuntu-latest], [28, x86, ubuntu-latest], [30, x86, macos-latest], [31, x86, macos-latest], [32, x86, macos-latest], [33, x86, macos-latest], [34, x86, macos-latest]]
runs-on: ${{ matrix.arch[2] }}
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -97,7 +96,7 @@ jobs:
- name: Setup Gradle Cache
uses: gradle/gradle-build-action@v2

- name: Restore Native Libs 2
- name: Restore Native Libs
id: restore-nativeLibs
uses: actions/cache@v3
with:
Expand All @@ -107,6 +106,7 @@ jobs:
nativeLibs/mupdfModule/build
nativeLibs/mupdfModule/.cxx
nativeLibs/djvuModule/build
nativeLibs/djvuModule/.cxx
key: ${{ runner.os }}-native-libs-${{ hashFiles('thirdparty_build.gradle') }}

- name: Prepare thirdparty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import universe.constellation.orion.viewer.prefs.GlobalOptions.TEST_SCREEN_HEIGH
import universe.constellation.orion.viewer.prefs.GlobalOptions.TEST_SCREEN_WIDTH
import universe.constellation.orion.viewer.test.framework.BookDescription
import universe.constellation.orion.viewer.test.framework.InstrumentationTestCase
import universe.constellation.orion.viewer.test.framework.MANUAL_DEBUG
import universe.constellation.orion.viewer.test.framework.compareBitmaps
import universe.constellation.orion.viewer.test.framework.dumpBitmap
import java.nio.IntBuffer


private val deviceSize = Point(300, 350) //to split page on two screen - page size is 663x886
internal const val MANUAL_DEBUG = false

@RunWith(Parameterized::class)
class RenderingAndNavigationTest(private val book: BookDescription) : InstrumentationTestCase(book.toOpenIntent(), additionalParams = {
Expand Down Expand Up @@ -63,7 +63,7 @@ class RenderingAndNavigationTest(private val book: BookDescription) : Instrument
assertEquals(deviceSize.x, bitmap.width)
assertEquals(deviceSize.y, bitmap.height)

assertEquals(book.pageCount, controller.pageCount)
assertEquals("Check page count:", book.pageCount, controller.pageCount)
assertEquals(0, controller.currentPage)

val nextPageList = arrayListOf<IntArray>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package universe.constellation.orion.viewer.test.framework
import android.graphics.Bitmap
import android.os.Build
import android.os.Environment
import androidx.test.espresso.Espresso
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.GrantPermissionRule
import androidx.test.uiautomator.By
Expand All @@ -16,16 +19,17 @@ import org.junit.Rule
import org.junit.rules.TestName
import universe.constellation.orion.viewer.BuildConfig
import universe.constellation.orion.viewer.FileUtil
import universe.constellation.orion.viewer.R
import universe.constellation.orion.viewer.djvu.DjvuDocument
import universe.constellation.orion.viewer.document.Document
import universe.constellation.orion.viewer.document.DocumentWithCaching
import universe.constellation.orion.viewer.document.DocumentWithCachingImpl
import universe.constellation.orion.viewer.test.MANUAL_DEBUG
import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import kotlin.math.abs

internal const val MANUAL_DEBUG = false

abstract class BaseTest {

Expand All @@ -46,6 +50,8 @@ abstract class BaseTest {
assertTrue(findObject.isChecked)
device.pressBack()
Thread.sleep(1000)
Espresso.onView(ViewMatchers.withId(R.id.view)).check(matches(ViewMatchers.isDisplayed()))
Espresso.onView(ViewMatchers.withId(R.id.view)).check(matches(ViewMatchers.isCompletelyDisplayed()))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import universe.constellation.orion.viewer.BuildConfig
import universe.constellation.orion.viewer.OrionViewerActivity
import universe.constellation.orion.viewer.test.MANUAL_DEBUG

@RunWith(Parameterized::class)
abstract class BookTest(path: String) : BaseTest() {
Expand Down

0 comments on commit b79c3c3

Please sign in to comment.