Skip to content

Commit 7df94df

Browse files
Przemek Bruskipbruski
authored andcommitted
use native JavaScript conditions for performance-intensive checks
1 parent 5638a59 commit 7df94df

13 files changed

+66
-20
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies {
4242
implementation("org.glassfish:javax.json:1.1")
4343
implementation("org.apache.commons:commons-math3:3.6.1")
4444
implementation("com.atlassian.performance.tools:concurrency:[1.0.0,2.0.0)")
45+
implementation("com.atlassian.performance:selenium-js:[1.0.0,2.0.0)")
4546
listOf(
4647
"api",
4748
"core",

gradle/dependency-locks/compileClasspath.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is expected to be part of source control.
44
com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:jvm-tasks:1.0.0
6+
com.atlassian.performance:selenium-js:1.0.0
67
com.github.stephenc.jcip:jcip-annotations:1.0-1
78
com.google.code.findbugs:jsr305:1.3.9
89
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/default.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is expected to be part of source control.
44
com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:jvm-tasks:1.0.0
6+
com.atlassian.performance:selenium-js:1.0.0
67
com.github.stephenc.jcip:jcip-annotations:1.0-1
78
com.google.code.findbugs:jsr305:1.3.9
89
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/implementationDependenciesMetadata.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is expected to be part of source control.
44
com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:jvm-tasks:1.0.0
6+
com.atlassian.performance:selenium-js:1.0.0
67
com.github.stephenc.jcip:jcip-annotations:1.0-1
78
com.google.code.findbugs:jsr305:1.3.9
89
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/runtimeClasspath.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# This file is expected to be part of source control.
44
com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:jvm-tasks:1.0.0
6+
com.atlassian.performance:selenium-js:1.0.0
67
com.github.stephenc.jcip:jcip-annotations:1.0-1
78
com.google.code.findbugs:jsr305:1.3.9
89
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/testCompileClasspath.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:docker-infrastructure:0.1.2
66
com.atlassian.performance.tools:io:1.2.0
77
com.atlassian.performance.tools:jvm-tasks:1.0.0
8+
com.atlassian.performance:selenium-js:1.0.0
89
com.github.stephenc.jcip:jcip-annotations:1.0-1
910
com.google.code.findbugs:jsr305:1.3.9
1011
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/testImplementationDependenciesMetadata.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:docker-infrastructure:0.1.2
66
com.atlassian.performance.tools:io:1.2.0
77
com.atlassian.performance.tools:jvm-tasks:1.0.0
8+
com.atlassian.performance:selenium-js:1.0.0
89
com.github.stephenc.jcip:jcip-annotations:1.0-1
910
com.google.code.findbugs:jsr305:1.3.9
1011
com.google.code.gson:gson:2.8.2

gradle/dependency-locks/testRuntimeClasspath.lockfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ com.atlassian.performance.tools:concurrency:1.0.0
55
com.atlassian.performance.tools:docker-infrastructure:0.1.2
66
com.atlassian.performance.tools:io:1.2.0
77
com.atlassian.performance.tools:jvm-tasks:1.0.0
8+
com.atlassian.performance:selenium-js:1.0.0
89
com.github.stephenc.jcip:jcip-annotations:1.0-1
910
com.google.code.findbugs:jsr305:1.3.9
1011
com.google.code.gson:gson:2.8.2

src/main/kotlin/com/atlassian/performance/tools/jiraactions/api/page/BrowseProjectsPage.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package com.atlassian.performance.tools.jiraactions.api.page
22

3+
import com.atlassian.performance.seleniumjs.NativeExpectedConditions.Companion.or
4+
import com.atlassian.performance.seleniumjs.NativeExpectedConditions.Companion.presenceOfElementLocated
35
import com.atlassian.performance.tools.jiraactions.api.memories.Project
46
import org.openqa.selenium.By
57
import org.openqa.selenium.WebDriver
68
import org.openqa.selenium.WebElement
7-
import org.openqa.selenium.support.ui.ExpectedConditions
89
import java.time.Duration
910

1011
class BrowseProjectsPage(
@@ -16,10 +17,10 @@ class BrowseProjectsPage(
1617
val jiraErrors = JiraErrors(driver)
1718
driver.wait(
1819
Duration.ofSeconds(6),
19-
ExpectedConditions.or(
20-
ExpectedConditions.presenceOfElementLocated(By.cssSelector("tbody.projects-list")),
21-
ExpectedConditions.presenceOfElementLocated(By.className("none-panel")),
22-
jiraErrors.anyCommonError()
20+
or(
21+
presenceOfElementLocated(By.cssSelector("tbody.projects-list")),
22+
presenceOfElementLocated(By.className("none-panel")),
23+
jiraErrors.anyCommonErrorNative()
2324
)
2425
)
2526
jiraErrors.assertNoErrors()
@@ -65,4 +66,4 @@ class BrowseProjectsPage(
6566
Project(projectKey, projectName)
6667
}.toSet()
6768
}
68-
}
69+
}

src/main/kotlin/com/atlassian/performance/tools/jiraactions/api/page/IssueNavigatorPage.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package com.atlassian.performance.tools.jiraactions.api.page
22

3+
import com.atlassian.performance.seleniumjs.NativeExpectedConditions.Companion.and
4+
import com.atlassian.performance.seleniumjs.NativeExpectedConditions.Companion.or
5+
import com.atlassian.performance.seleniumjs.NativeExpectedConditions.Companion.presenceOfElementLocated
36
import com.atlassian.performance.tools.jiraactions.api.webdriver.JavaScriptUtils
47
import org.openqa.selenium.By
58
import org.openqa.selenium.WebDriver
6-
import org.openqa.selenium.support.ui.ExpectedConditions.*
79
import java.time.Duration
810

911
class IssueNavigatorPage(
@@ -30,7 +32,7 @@ class IssueNavigatorPage(
3032
presenceOfElementLocated(By.className("issue-body-content"))
3133
),
3234
presenceOfElementLocated(By.className("no-results-hint")),
33-
jiraErrors.anyCommonError()
35+
jiraErrors.anyCommonErrorNative()
3436
)
3537
)
3638
return this

0 commit comments

Comments
 (0)