Skip to content

Commit

Permalink
Merge branch 'trunk' into add-cdp-preference
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani authored Jun 11, 2024
2 parents b7631ca + 734cca0 commit bfe98ae
Show file tree
Hide file tree
Showing 33 changed files with 3,719 additions and 835 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
node-version: ${{ inputs.node-version }}
- name: Setup Bazel with caching
if: inputs.caching
uses: bazel-contrib/[email protected].4
uses: bazel-contrib/[email protected].5
with:
bazelisk-cache: true
bazelrc: common --color=yes
Expand All @@ -130,7 +130,7 @@ jobs:
repository-cache: true
- name: Setup Bazel without caching
if: inputs.caching == false
uses: bazel-contrib/[email protected].4
uses: bazel-contrib/[email protected].5
with:
bazelrc: common --color=yes
- name: Setup Fluxbox and Xvfb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
fetch-depth: 50
- name: Setup Bazel
uses: bazel-contrib/[email protected].4
uses: bazel-contrib/[email protected].5
with:
bazelisk-cache: true
cache-version: 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fetch-tags: true
ref: release-${{ github.event.inputs.version }}
- name: Install Ruby
uses: ruby/setup-ruby@7dc18ff0ca6e3630d3f29d2a85ebf6cc27ae9d6c
uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55
with:
ruby-version: '3.1'
working-directory: 'rb'
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ bazel_dep(name = "aspect_bazel_lib", version = "2.7.6")
bazel_dep(name = "aspect_rules_esbuild", version = "0.20.0")
bazel_dep(name = "aspect_rules_js", version = "1.42.3")
bazel_dep(name = "aspect_rules_ts", version = "2.1.0")
bazel_dep(name = "bazel_features", version = "1.9.1")
bazel_dep(name = "bazel_features", version = "1.12.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
bazel_dep(name = "contrib_rules_jvm", version = "0.24.0")
bazel_dep(name = "contrib_rules_jvm", version = "0.27.0")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_dotnet", version = "0.14.0")
bazel_dep(name = "rules_dotnet", version = "0.15.1")
bazel_dep(name = "rules_java", version = "7.4.0")
bazel_dep(name = "rules_jvm_external", version = "6.1")
bazel_dep(name = "rules_nodejs", version = "6.0.5")
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ rules_closure_toolchains()

http_archive(
name = "rules_rust",
integrity = "sha256-JLN47ZcAbx9wEr5Jiib4HduZATGLiDgK7oUi/fvotzU=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.42.1/rules_rust-v0.42.1.tar.gz"],
integrity = "sha256-F8U7+AC5MvMtPKGdLLnorVM84cDXKfDRgwd7/dq3rUY=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.46.0/rules_rust-v0.46.0.tar.gz"],
)

load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
Expand Down
57 changes: 0 additions & 57 deletions dotnet/paket.bzl

This file was deleted.

94 changes: 47 additions & 47 deletions dotnet/paket.nuget.bzl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dotnet/paket.nuget_extension.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"Generated by paket2bazel"
"Generated"

load(":paket.nuget.bzl", _nuget = "nuget")

Expand Down
6 changes: 0 additions & 6 deletions dotnet/src/support/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ csharp_library(
target_frameworks = [
"netstandard2.0",
],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
visibility = [
"//dotnet:__subpackages__",
],
Expand Down Expand Up @@ -82,9 +79,6 @@ csharp_library(
target_frameworks = [
"netstandard2.0",
],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
visibility = [
"//dotnet:__subpackages__",
],
Expand Down
6 changes: 0 additions & 6 deletions dotnet/src/webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ csharp_library(
target_frameworks = [
"netstandard2.0",
],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
visibility = [
"//dotnet:__subpackages__",
],
Expand Down Expand Up @@ -79,9 +76,6 @@ csharp_library(
target_frameworks = [
"netstandard2.0",
],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
visibility = [
"//dotnet:__subpackages__",
],
Expand Down
6 changes: 0 additions & 6 deletions dotnet/test/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ csharp_library(
"//common/manager:selenium-manager-macos",
],
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "Microsoft.NETCore.App.Ref"),
],
visibility = [
"//dotnet/test:__subpackages__",
],
Expand Down Expand Up @@ -89,9 +86,6 @@ dotnet_nunit_test_suite(
":test-data",
],
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "Microsoft.NETCore.App.Ref"),
],
deps = [
":fixtures",
"//dotnet/src/webdriver",
Expand Down
6 changes: 0 additions & 6 deletions dotnet/test/support/Events/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ dotnet_nunit_test_suite(
size = "small",
srcs = SMALL_TESTS,
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
deps = [
"//dotnet/src/support",
"//dotnet/src/webdriver",
Expand Down Expand Up @@ -40,9 +37,6 @@ dotnet_nunit_test_suite(
"//dotnet/test/common:test-data",
],
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
deps = [
"//dotnet/src/support",
"//dotnet/src/webdriver",
Expand Down
3 changes: 0 additions & 3 deletions dotnet/test/support/Extensions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ dotnet_nunit_test_suite(
size = "small",
srcs = glob(["*.cs"]),
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
deps = [
"//dotnet/src/support",
"//dotnet/src/webdriver",
Expand Down
6 changes: 0 additions & 6 deletions dotnet/test/support/UI/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ dotnet_nunit_test_suite(
size = "small",
srcs = SMALL_TESTS,
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
deps = [
"//dotnet/src/support",
"//dotnet/src/webdriver",
Expand Down Expand Up @@ -45,9 +42,6 @@ dotnet_nunit_test_suite(
"//dotnet/test/common:test-data",
],
target_frameworks = ["net7.0"],
targeting_packs = [
framework("nuget", "NETStandard.Library"),
],
deps = [
"//dotnet/src/support",
"//dotnet/src/webdriver",
Expand Down
2 changes: 1 addition & 1 deletion dotnet/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
(
cd "$SCRIPT_DIR" || exit 1
(dotnet tool restore && dotnet tool run paket install)
bazel run @rules_dotnet//tools/paket2bazel:paket2bazel.exe -- --dependencies-file "$(pwd)"/paket.dependencies --output-folder "$(pwd)"
bazel run @rules_dotnet//tools/paket2bazel:paket2bazel -- --dependencies-file "$(pwd)"/paket.dependencies --output-folder "$(pwd)"
)
2 changes: 1 addition & 1 deletion javascript/grid-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
]
},
"devDependencies": {
"@babel/preset-react": "7.24.1",
"@babel/preset-react": "7.24.7",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "14.3.1",
"@testing-library/user-event": "14.5.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

const { BrowsingContextInfo, NavigationInfo } = require('./browsingContextTypes')
const { BrowsingContextInfo, NavigationInfo, UserPromptOpened, UserPromptClosed } = require('./browsingContextTypes')

/**
* Represents a browsing context related events.
Expand Down Expand Up @@ -127,8 +127,10 @@ class BrowsingContextInspector {
let response = null
if ('navigation' in params) {
response = new NavigationInfo(params.context, params.navigation, params.timestamp, params.url)
} else if ('type' in params) {
response = new UserPromptOpened(params.context, params.type, params.message)
} else if ('accepted' in params) {
/* Needs to be updated when browsers implement other events */
response = new UserPromptClosed(params.context, params.accepted, params.userText)
} else {
response = new BrowsingContextInfo(params.context, params.url, params.children, params.parent)
}
Expand Down
18 changes: 17 additions & 1 deletion javascript/node/selenium-webdriver/bidi/browsingContextTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,20 @@ class NavigationInfo {
}
}

module.exports = { BrowsingContextInfo, NavigationInfo }
class UserPromptOpened {
constructor(browsingContextId, type, message) {
this.browsingContextId = browsingContextId
this.type = type
this.message = message
}
}

class UserPromptClosed {
constructor(browsingContextId, accepted, userText = undefined) {
this.browsingContextId = browsingContextId
this.accepted = accepted
this.userText = userText
}
}

module.exports = { BrowsingContextInfo, NavigationInfo, UserPromptOpened, UserPromptClosed }
Original file line number Diff line number Diff line change
Expand Up @@ -158,52 +158,67 @@ suite(
assert(navigationInfo.url.includes('linkToAnchorOnThisPage'))
})

xit('can listen to user prompt opened event', async function () {
let userpromptOpened = null
const browsingConextInspector = await BrowsingContextInspector(driver)
ignore(env.browsers(Browser.EDGE, Browser.CHROME)).it(
'can listen to user prompt opened event',
async function () {
let userpromptOpened = null
const browsingcontextInspector = await BrowsingContextInspector(driver)

const browsingContext = await BrowsingContext(driver, {
browsingContextId: await driver.getWindowHandle(),
})
const browsingContext = await BrowsingContext(driver, {
browsingContextId: await driver.getWindowHandle(),
})

await driver.get(Pages.alertsPage)
await browsingcontextInspector.onUserPromptOpened((entry) => {
userpromptOpened = entry
})

await driver.findElement(By.id('alert')).click()
await driver.get(Pages.alertsPage)

await driver.wait(until.alertIsPresent())
await driver.findElement(By.id('alert')).click()

await browsingConextInspector.onUserPromptOpened((entry) => {
userpromptOpened = entry
})
await driver.wait(until.alertIsPresent())

assert.equal(userpromptOpened.browsingContextId, browsingContext.id)
assert.equal(userpromptOpened.type, 'alert')
})
await browsingContext.handleUserPrompt(true)

xit('can listen to user prompt closed event', async function () {
let userpromptClosed = null
const browsingConextInspector = await BrowsingContextInspector(driver)
// Chrome/Edge do not return the window's browsing context id as per the spec.
// This assertion fails.
// It is probably a bug in the Chrome/Edge driver.
assert.equal(userpromptOpened.browsingContextId, browsingContext.id)
assert.equal(userpromptOpened.type, 'alert')
},
)

const browsingContext = await BrowsingContext(driver, {
browsingContextId: await driver.getWindowHandle(),
})
ignore(env.browsers(Browser.EDGE, Browser.CHROME)).it(
'can listen to user prompt closed event',
async function () {
const windowHandle = await driver.getWindowHandle()
let userpromptClosed = null
const browsingcontextInspector = await BrowsingContextInspector(driver, windowHandle)

await driver.get(Pages.alertsPage)
const browsingContext = await BrowsingContext(driver, {
browsingContextId: windowHandle,
})

await driver.findElement(By.id('prompt')).click()
await driver.get(Pages.alertsPage)

await driver.wait(until.alertIsPresent())
await driver.findElement(By.id('prompt')).click()

await browsingConextInspector.onUserPromptClosed((entry) => {
userpromptClosed = entry
})
await driver.wait(until.alertIsPresent())

await browsingContext.handleUserPrompt(true, 'selenium')
await browsingcontextInspector.onUserPromptClosed((entry) => {
userpromptClosed = entry
})

assert.equal(userpromptClosed.browsingContextId, browsingContext.id)
assert.equal(userpromptClosed.accepted, true)
assert.equal(userpromptClosed.userText, 'selenium')
})
await browsingContext.handleUserPrompt(true, 'selenium')

// Chrome/Edge do not return the window's browsing context id as per the spec.
// This assertion fails.
// It is probably a bug in the Chrome/Edge driver.
assert.equal(userpromptClosed.browsingContextId, browsingContext.id)
assert.equal(userpromptClosed.accepted, true)
assert.equal(userpromptClosed.userText, 'selenium')
},
)
})
},
{ browsers: [Browser.FIREFOX, Browser.CHROME, Browser.EDGE] },
Expand Down
Loading

0 comments on commit bfe98ae

Please sign in to comment.