Skip to content

Update windows.en.md #1535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions examples/ruby/spec/interactions/windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@

RSpec.describe 'Windows' do
let(:driver) { start_session }

it 'opens new tab' do
driver.switch_to.new_window(:tab)

expect(driver.window_handles.size).to eq 2
end

it 'opens new window' do
driver.switch_to.new_window(:window)

expect(driver.window_handles.size).to eq 2
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,13 @@ driver.SwitchTo().NewWindow(WindowType.Tab)
// Opens a new window and switches to new window
driver.SwitchTo().NewWindow(WindowType.Window)
{{< /tab >}}
{{< tab header="Ruby" >}}
# Note: The new_window in ruby only opens a new tab (or) Window and will not switch automatically
# The user has to switch to new tab (or) new window

# Opens a new tab and switches to new tab
driver.manage.new_window(:tab)
{{% tab header="Ruby" text=true %}}
Opens a new tab and switches to new tab
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L9" >}}

# Opens a new window and switches to new window
driver.manage.new_window(:window)
{{< /tab >}}
Opens a new window and switches to new window
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L15" >}}
{{% /tab %}}
{{< tab header="JavaScript" >}}
// Opens a new tab and switches to new tab
await driver.switchTo().newWindow('tab');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,13 @@ driver.SwitchTo().NewWindow(WindowType.Tab)
// Opens a new window and switches to new window
driver.SwitchTo().NewWindow(WindowType.Window)
{{< /tab >}}
{{< tab header="Ruby" >}}
# Note: The new_window in ruby only opens a new tab (or) Window and will not switch automatically
# The user has to switch to new tab (or) new window

# Opens a new tab and switches to new tab
driver.manage.new_window(:tab)
{{% tab header="Ruby" text=true %}}
Opens a new tab and switches to new tab
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L9" >}}

# Opens a new window and switches to new window
driver.manage.new_window(:window)
{{< /tab >}}
Opens a new window and switches to new window
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L15" >}}
{{% /tab %}}
{{< tab header="JavaScript" >}}
// Opens a new tab and switches to new tab
await driver.switchTo().newWindow('tab');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,13 @@ driver.SwitchTo().NewWindow(WindowType.Tab)
// Opens a new window and switches to new window
driver.SwitchTo().NewWindow(WindowType.Window)
{{< /tab >}}
{{< tab header="Ruby" >}}
# Note: The new_window in ruby only opens a new tab (or) Window and will not switch automatically
# The user has to switch to new tab (or) new window

# Opens a new tab and switches to new tab
driver.manage.new_window(:tab)
{{% tab header="Ruby" text=true %}}
Opens a new tab and switches to new tab
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L9" >}}

# Opens a new window and switches to new window
driver.manage.new_window(:window)
{{< /tab >}}
Opens a new window and switches to new window
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L15" >}}
{{% /tab %}}
{{< tab header="JavaScript" >}}
// Opens a new tab and switches to new tab
await driver.switchTo().newWindow('tab');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,13 @@ driver.SwitchTo().NewWindow(WindowType.Tab)
// 打开一个新窗口并切换到新窗口
driver.SwitchTo().NewWindow(WindowType.Window)
{{< /tab >}}
{{< tab header="Ruby" >}}
# 注意:ruby 中的 new_window 只打开一个新标签页(或)窗口,不会自动切换
# 用户必须切换到新选项卡 (或) 新窗口

# 打开新标签页并切换到新标签页
driver.manage.new_window(:tab)
{{% tab header="Ruby" text=true %}}
打开新标签页并切换到新标签页
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L9" >}}

# 打开一个新窗口并切换到新窗口
driver.manage.new_window(:window)
{{< /tab >}}
打开一个新窗口并切换到新窗口
{{< gh-codeblock path="/examples/ruby/spec/interactions/windows_spec.rb#L15" >}}
{{% /tab %}}
{{< tab header="JavaScript" >}}
// 打开新标签页并切换到新标签页
await driver.switchTo().newWindow('tab');
Expand Down