Skip to content

Commit 47e84af

Browse files
sv-hyacoubHani Yacoub
andauthored
Hani/ Test paste and go opens correct url (#905)
* Test paste and go opens correct url * edit test * Test paste and go opens correct url * Edit code --------- Co-authored-by: Hani Yacoub <[email protected]>
1 parent dc8d12e commit 47e84af

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

SELECTOR_INFO.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,13 @@ Description: bsky website sign in button
23302330
Location: Bsky website
23312331
Path to .json: modules/data/generic_page.components.json
23322332
```
2333+
```
2334+
Selector Name: url-to-copy
2335+
Selector Data: "p[contenteditable]"
2336+
Description: Clipboard page to copy url
2337+
Location: Clipboard test page
2338+
Path to .json: modules/data/generic_page.components.json
2339+
```
23332340
#### generic_pdf
23342341
```
23352342
Selector Name: highlighted-text

modules/data/generic_page.components.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,11 @@
7676
"selectorData": "//button[@aria-label='Sign in']",
7777
"strategy": "xpath",
7878
"groups": []
79+
},
80+
81+
"url-to-copy": {
82+
"selectorData": "p[contenteditable]",
83+
"strategy": "css",
84+
"groups": []
7985
}
8086
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import pytest
2+
from selenium.webdriver import Firefox, Keys
3+
4+
from modules.browser_object_navigation import Navigation
5+
from modules.page_object_generics import GenericPage
6+
7+
CLIPBOARD_PAGE = "https://bug1320502.bmoattachments.org/attachment.cgi?id=8814655"
8+
URL = "https://developer.mozilla.org"
9+
10+
11+
@pytest.fixture()
12+
def test_case():
13+
return "3028883"
14+
15+
16+
def test_paste_and_go_opens_correct_url(driver: Firefox):
17+
"""
18+
C3028883 - "Paste and Go" opens the right URL
19+
"""
20+
21+
# Instantiate objects
22+
nav = Navigation(driver)
23+
page = GenericPage(driver, url=CLIPBOARD_PAGE)
24+
25+
# Copy the link from the clipboard
26+
page.open()
27+
page.click_on("url-to-copy")
28+
page.perform_key_combo(Keys.CONTROL, "a")
29+
page.copy()
30+
31+
# Open a new tab and right click in the Address bar and choose Paste and Go
32+
nav.open_and_switch_to_new_window("tab")
33+
nav.get_awesome_bar()
34+
nav.click_and_hide_menu("context-menu-paste-and-go")
35+
36+
# Check that the page is displayed
37+
nav.url_contains(URL)

0 commit comments

Comments
 (0)