Skip to content

Commit

Permalink
Replace up, down, left and right with horizontal and `verti…
Browse files Browse the repository at this point in the history
…cal`
  • Loading branch information
darmen committed Dec 7, 2023
1 parent 8caa7e4 commit 96f2dc1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ class ScrollBuilder {
return x to y
}

fun up(value: Int) {
y += value
}

fun down(value: Int) {
up(-value)
}

fun left(value: Int) {
right(-value)
fun horizontal(value: Int) {
x += value
}

fun right(value: Int) {
x += value
fun vertical(value: Int) {
y += value
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,16 @@ class ScrollBuilderTest {
private val sut = ScrollBuilder()

@Test
fun `up increases y`() {
sut.up(10)
fun `vertical adjusts y`() {
sut.vertical(10)

assertEquals(10, sut.build().second)
}

@Test
fun `down decreases y`() {
sut.down(10)

assertEquals(-10, sut.build().second)
}

@Test
fun `right increases x`() {
sut.right(10)
fun `horizontal increases x`() {
sut.horizontal(10)

assertEquals(10, sut.build().first)
}

@Test
fun `left decreases x`() {
sut.left(10)

assertEquals(-10, sut.build().first)
}
}
6 changes: 2 additions & 4 deletions src/test/kotlin/com/personio/synthetics/e2e/E2EBrowserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ class E2EBrowserTest {
goto("Go to URL", "https://synthetic-test.personio.de/test")

scroll("Scroll using coordinates") {
up(10)
down(5)
left(20)
right(20)
horizontal(10)
vertical(20)
}
}
}
Expand Down

0 comments on commit 96f2dc1

Please sign in to comment.