1
1
package org.catrobat.paintroid.test.espresso.tools
2
2
3
- import android.graphics.Bitmap
4
- import android.graphics.Color
5
- import android.graphics.PointF
6
- import android.widget.SeekBar
7
3
import androidx.test.espresso.Espresso.onView
8
- import androidx.test.espresso.PerformException
9
- import androidx.test.espresso.action.ViewActions.*
10
- import androidx.test.espresso.assertion.ViewAssertions
4
+ import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
5
+ import androidx.test.espresso.action.ViewActions.replaceText
6
+ import androidx.test.espresso.action.ViewActions.click
11
7
import androidx.test.espresso.assertion.ViewAssertions.matches
12
- import androidx.test.espresso.matcher.ViewMatchers.*
13
- import androidx.test.ext.junit.runners.AndroidJUnit4
14
- import androidx.test.filters.LargeTest
8
+ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
9
+ import androidx.test.espresso.matcher.ViewMatchers.withId
10
+ import androidx.test.espresso.matcher.ViewMatchers.withText
15
11
import androidx.test.rule.ActivityTestRule
16
- import kotlinx.coroutines.delay
17
- import kotlinx.coroutines.runBlocking
18
12
import org.catrobat.paintroid.MainActivity
19
13
import org.catrobat.paintroid.R
20
14
import org.catrobat.paintroid.contract.LayerContracts
21
- import org.catrobat.paintroid.test.espresso.util.DrawingSurfaceLocationProvider
22
- import org.catrobat.paintroid.test.espresso.util.EspressoUtils.waitForToast
23
15
import org.catrobat.paintroid.test.espresso.util.MainActivityHelper
24
- import org.catrobat.paintroid.test.espresso.util.UiInteractions
25
- import org.catrobat.paintroid.test.espresso.util.wrappers.DrawingSurfaceInteraction.Companion.onDrawingSurfaceView
26
- import org.catrobat.paintroid.test.espresso.util.wrappers.LayerMenuViewInteraction
27
16
import org.catrobat.paintroid.test.espresso.util.wrappers.ToolBarViewInteraction
28
- import org.catrobat.paintroid.test.espresso.util.wrappers.ToolBarViewInteraction.Companion.onToolBarView
29
- import org.catrobat.paintroid.test.espresso.util.wrappers.ToolPropertiesInteraction
30
- import org.catrobat.paintroid.test.espresso.util.wrappers.TopBarViewInteraction
31
- import org.catrobat.paintroid.test.espresso.util.wrappers.TransformToolOptionsViewInteraction.Companion.onTransformToolOptionsView
32
17
import org.catrobat.paintroid.test.utils.ScreenshotOnFailRule
33
18
import org.catrobat.paintroid.tools.ToolReference
34
19
import org.catrobat.paintroid.tools.ToolType
35
- import org.catrobat.paintroid.tools.implementation.*
20
+ import org.catrobat.paintroid.tools.implementation.MAXIMUM_BITMAP_SIZE_FACTOR
21
+ import org.catrobat.paintroid.tools.implementation.PixelTool
36
22
import org.catrobat.paintroid.ui.Perspective
37
- import org.hamcrest.Matchers.equalTo
38
- import org.hamcrest.Matchers.greaterThan
39
- import org.hamcrest.Matchers.lessThan
40
- import org.hamcrest.Matchers.not
41
23
import org.junit.Assert.assertEquals
42
- import org.junit.Assert.assertThat
43
- import org.junit.Assert.assertTrue
44
24
import org.junit.Before
45
25
import org.junit.Rule
46
26
import org.junit.Test
47
- import org.junit.runner.RunWith
48
27
49
28
class PixelationToolIntegrationTest {
50
29
@get:Rule
@@ -64,23 +43,8 @@ class PixelationToolIntegrationTest {
64
43
private lateinit var toolReference: ToolReference
65
44
private lateinit var mainActivity: MainActivity
66
45
private lateinit var activityHelper: MainActivityHelper
67
- private lateinit var pixelTool : PixelTool
46
+ private lateinit var pixelTool: PixelTool
68
47
69
- private var toolSelectionBoxHeight: Float
70
- get() {
71
- return (toolReference.tool as BaseToolWithRectangleShape ).boxHeight
72
- }
73
- private set(height) {
74
- (toolReference.tool as BaseToolWithRectangleShape ).boxHeight = height
75
- }
76
-
77
- private var toolSelectionBoxWidth: Float
78
- get() {
79
- return (toolReference.tool as BaseToolWithRectangleShape ).boxWidth
80
- }
81
- private set(width) {
82
- (toolReference.tool as BaseToolWithRectangleShape ).boxWidth = width
83
- }
84
48
@Before
85
49
fun setUp () {
86
50
mainActivity = launchActivityRule.activity
@@ -101,9 +65,7 @@ class PixelationToolIntegrationTest {
101
65
}
102
66
103
67
@Test
104
- fun inputeTest ()
105
- {
106
-
68
+ fun inputeTest () {
107
69
var width = 80.0f
108
70
var height = 49.0f
109
71
onView(withId(R .id.pocketpaint_pixel_width_value))
@@ -133,4 +95,4 @@ class PixelationToolIntegrationTest {
133
95
assertEquals(pixelTool.numPixelHeight, height)
134
96
// assertEquals(pixelTool.numCollors.toInt(),collor )
135
97
}
136
- }
98
+ }
0 commit comments