Skip to content

Commit

Permalink
Changes in version 1.7.5
Browse files Browse the repository at this point in the history
------------------------
* kotlin 2.0.20
* selenium java 4.25.0
* selenium docker 4.25.0-20241024
  • Loading branch information
hibissscus committed Oct 31, 2024
1 parent 9277975 commit 7bbfb49
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 23 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Changes in version 1.7.5
------------------------
* kotlin 2.0.20
* selenium java 4.25.0
* selenium docker 4.25.0-20241024


Changes in version 1.7.4
------------------------
* reportng 1.5.6
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
plugins {
java
kotlin("jvm") version "1.9.23"
kotlin("jvm") version "2.0.20"
id("maven-publish")
id("java-library")
id("org.jetbrains.dokka") version "1.9.20"
id("com.avast.gradle.docker-compose") version ("0.17.6")
id("com.avast.gradle.docker-compose") version ("0.17.8")
}


group = "it.testee"
version = "1.7.4"
version = "1.7.5"


repositories {
Expand All @@ -23,7 +23,7 @@ dependencies {
// kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib")
// selenium
implementation("org.seleniumhq.selenium:selenium-java:4.19.1")
implementation("org.seleniumhq.selenium:selenium-java:4.25.0")
// testng
implementation("org.testng", "testng", "7.5")
// reportng
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ version: "3.9"
services:
selenium-hub:
container_name: selenium-hub
image: selenium/hub:4.19.1-20240402
image: selenium/hub:4.25.0-20241024
ports:
- "4444:4444"
- "4443:4443"
- "4442:4442"
environment:
- TZ=Europe/Berlin
chrome:
image: selenium/node-chrome:4.19.1-20240402
image: selenium/node-chrome:4.25.0-20241024
deploy:
replicas: 3
shm_size: 512m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ object WebDriverFactory {
opt.addArguments("--disable-notifications")
opt.addArguments("--window-size=1280,800")
opt.addArguments("--lang=de")
opt.addArguments("--disable-search-engine-choice-screen")


val prefs = HashMap<String, Any>()
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/testee/it/e2e/example/BasePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ abstract class BasePage(driver: WebDriver) : AbstractPage(driver) {
/**
* View specific [Page] and check the [title] on the [Page]
*/
fun <P : BasePage, T : BasePage> P.view(page: T): T {
fun <T : BasePage> view(page: T): T {
(page).loaded().opened()
return page
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ class MatryoshkaPage(driver: WebDriver) : BasePage(driver) {
@FindBy(css = ".accept")
private lateinit var acceptCookieAgreement: WebElement

@FindBy(id = "home-open-url")
@FindBy(id = "splash-file-menu")
private lateinit var menu: WebElement

@FindBy(id = "splash-file-url")
private lateinit var createNewFromUrl: WebElement

@FindBy(id = "image-url")
Expand Down Expand Up @@ -98,6 +101,8 @@ class MatryoshkaPage(driver: WebDriver) : BasePage(driver) {
}

fun openNewImageFromUrl(imageUrlStr: String): MatryoshkaPage = apply {
clickIfVisible(menu)
visible(createNewFromUrl)
click(createNewFromUrl)
sendText(imageUrl, imageUrlStr)
click(dialogApply)
Expand Down
19 changes: 13 additions & 6 deletions src/main/kotlin/testee/it/e2e/example/piano/PianoPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.openqa.selenium.By
import org.openqa.selenium.JavascriptExecutor
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.interactions.Actions
import org.openqa.selenium.support.FindBy
import org.openqa.selenium.support.ui.ExpectedConditions
import testee.it.e2e.example.BasePage
Expand Down Expand Up @@ -56,17 +57,23 @@ class PianoPage(driver: WebDriver) : BasePage(driver) {
}

fun mentorPlay(pause: Long = 180): PianoPage = apply {
setHighlight()
waitForSeconds(5)
click(start)
// setHighlight()
// waitForSeconds(5)
// click(start)
println("Start")
do {
driver().findElements(By.cssSelector(".key-white.key-next, .key-black.key-next"))
val start = driver().findElement(By.id("song-pattern")).findElements(By.tagName("span"))
.first().text
Actions(driver).sendKeys("start").perform()
driver().findElement(By.id("song-pattern")).findElements(By.tagName("span"))
.filter { !it.text.equals(".") }
.drop(0)
.forEach {
println(it.getAttribute("id") + ",")
println(it.text + ",")
click(it)
Thread.sleep(pause)
}
Thread.sleep(pause)

println("|")
} while (
tick().until(ExpectedConditions.numberOfElementsToBeMoreThan(By.cssSelector(".key-white.key-next, .key-black.key-next"), 0)).size > 0
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/testee/it/tests/example/piano/PianoTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PianoTest : TestBase(url = "https://virtualpiano.net", browser = Browser.C
PianoPage(driver)
.open("$url/?song-post-" + Note.FLY.id)
.loaded()
.hideCookies()
.mentorPlay()
.waitForSeconds(10)
}
Expand Down
10 changes: 1 addition & 9 deletions src/test/kotlin/testee/it/tests/example/slack/SlackTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ import org.testng.SkipException
import org.testng.annotations.Test
import testee.it.e2e.core.browser.Browser
import testee.it.e2e.core.test.TestBase
import testee.it.e2e.example.BasePage.Companion.loaded
import testee.it.e2e.example.BasePage.Companion.newTab
import testee.it.e2e.example.BasePage.Companion.switchTab
import testee.it.e2e.example.BasePage.Companion.view
import testee.it.e2e.example.BasePage.Companion.waitForSeconds
import testee.it.e2e.example.slack.model.Channels
import testee.it.e2e.example.slack.model.Slack
import testee.it.e2e.example.slack.model.Tokens
import testee.it.e2e.example.slack.model.User
import testee.it.e2e.example.slack.model.Workspace
import testee.it.e2e.example.slack.pages.SlackApiPage
import testee.it.e2e.example.slack.pages.SlackWebLoginPage
import testee.it.e2e.example.slack.pages.SlackWebPage
import kotlin.random.Random

Expand All @@ -28,11 +24,7 @@ class SlackTest : TestBase(url = Slack.WEB.slack, browser = Browser.CHROME) {

@Test
fun `01 login into slack web`() {
SlackWebLoginPage(driver)
.opened()
.acceptAllCookies()
.login(Workspace.WORKSPACE, User.TEST)
.view(SlackWebPage(driver))
view(SlackWebPage(driver))
}

@Test
Expand Down

0 comments on commit 7bbfb49

Please sign in to comment.