Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Fix selectors & smoke test #168

Merged
merged 2 commits into from
Dec 11, 2017
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
51 changes: 25 additions & 26 deletions tests/exred/pages/footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,37 @@

SECTIONS = {
"export readiness": {
"label": "#footer-links-2",
"new": "#footer a[href='/new']",
"occasional": "#footer a[href='/occasional']",
"regular": "#footer a[href='/regular']",
"i'm new to exporting": "#footer a[href='/new']",
"i export occasionally": "#footer a[href='/occasional']",
"i'm a regular exporter": "#footer a[href='/regular']"
"label": "#footer-export-readiness-links",
"new": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(1) > a",
"occasional": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(2) > a",
"regular": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(3) > a",
"i'm new to exporting": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(1) > a",
"i export occasionally": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(2) > a",
"i'm a regular exporter": "#footer ul[aria-labelledby='footer-export-readiness-links'] > li:nth-child(3) > a"
},
"guidance": {
"label": "#footer-links-3",
"market research": "#footer a[href='/market-research']",
"customer insight": "#footer a[href='/customer-insight']",
"finance": "#footer a[href='/finance']",
"business planning": "#footer a[href='/business-planning']",
"getting paid": "#footer a[href='/getting-paid']",
"operations and compliance": "#footer a[href='/operations-and-compliance']"
"label": "#footer-guidance-links",
"market research": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(1) > a",
"customer insight": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(2) > a",
"finance": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(3) > a",
"business planning": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(4) > a",
"getting paid": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(5) > a",
"operations and compliance": "#footer ul[aria-labelledby='footer-guidance-links'] > li:nth-child(6) > a"
},
"services": {
"label": "#footer-links-4",
"find a buyer": "#footer > nav > div:nth-child(4) > ul > li:nth-child(1) > a",
"selling online overseas": "#footer > nav > div:nth-child(4) > ul > li:nth-child(2) > a",
"export opportunities": "#footer a[href='/export-opportunities']",
"get finance": "#footer a[href='/get-finance']",
"events": "#footer > nav > div:nth-child(4) > ul > li:nth-child(5) > a"
"label": "footer-services-links",
"find a buyer": "#footer ul[aria-labelledby='footer-services-links'] > li:nth-child(1) > a",
"selling online overseas": "#footer ul[aria-labelledby='footer-services-links'] > li:nth-child(2) > a",
"export opportunities": "#footer ul[aria-labelledby='footer-services-links'] > li:nth-child(3) > a",
"get finance": "#footer ul[aria-labelledby='footer-services-links'] > li:nth-child(4) > a",
"events": "#footer ul[aria-labelledby='footer-services-links'] > li:nth-child(5) > a"
},
"general links": {
"part of great.gov.uk": "#footer > .site-links > ul > li:nth-child(1) > a",
"about": "#footer > .site-links > ul > li:nth-child(2) > a",
"contact us": "#footer > .site-links > ul > li:nth-child(3) > a",
"privacy and cookies": "#footer > .site-links > ul > li:nth-child(4) > a",
"terms and conditions": "#footer > .site-links > ul > li:nth-child(5) > a",
"department for international trade": "#footer > .site-links > ul > li:nth-child(6) > a"
"about": "#footer > .site-links > ul > li:nth-child(1) > a",
"contact us": "#footer > .site-links > ul > li:nth-child(2) > a",
"privacy and cookies": "#footer > .site-links > ul > li:nth-child(3) > a",
"terms and conditions": "#footer > .site-links > ul > li:nth-child(4) > a",
"department for international trade": "#footer > .site-links > ul > li:nth-child(5) > a"
}
}

Expand Down
28 changes: 14 additions & 14 deletions tests/exred/pages/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
SECTIONS = {
"export readiness": {
"menu": "#export-readiness-links",
"new": "#export-readiness-links-list a[href='/new']",
'occasional': "#export-readiness-links-list a[href='/occasional']",
"regular": "#export-readiness-links-list a[href='/regular']",
"i'm new to exporting": "#export-readiness-links-list a[href='/new']",
'i export occasionally': "#export-readiness-links-list a[href='/occasional']",
"i'm a regular exporter": "#export-readiness-links-list a[href='/regular']"
"new": "#export-readiness-links-list > li:nth-child(1) > a",
'occasional': "#export-readiness-links-list > li:nth-child(2) > a",
"regular": "#export-readiness-links-list > li:nth-child(3) > a",
"i'm new to exporting": "#export-readiness-links-list > li:nth-child(1) > a",
'i export occasionally': "#export-readiness-links-list > li:nth-child(2) > a",
"i'm a regular exporter": "#export-readiness-links-list > li:nth-child(3) > a"
},
"guidance": {
"menu": "#guidance-links",
"market research": "#guidance-links-list a[href='/market-research']",
"customer insight": "#guidance-links-list a[href='/customer-insight']",
"finance": "#guidance-links-list a[href='/finance']",
"business planning": "#guidance-links-list a[href='/business-planning']",
"getting paid": "#guidance-links-list a[href='/getting-paid']",
"operations and compliance": "#guidance-links-list a[href='/operations-and-compliance']"
"market research": "#guidance-links-list > li:nth-child(1) > a",
"customer insight": "#guidance-links-list > li:nth-child(2) > a",
"finance": "#guidance-links-list > li:nth-child(3) > a",
"business planning": "#guidance-links-list > li:nth-child(4) > a",
"getting paid": "#guidance-links-list > li:nth-child(5) > a",
"operations and compliance": "#guidance-links-list > li:nth-child(6) > a"
},
"services": {
"menu": "#services-links",
Expand All @@ -47,8 +47,8 @@
"get finance": "#services-links-list > li:nth-child(4) > a",
"events": "#services-links-list > li:nth-child(5) > a"
},
"government links": {
"part of great.gov.uk": "#header-bar p.government-links > a"
"general": {
"logo": "#header-bar > div:nth-child(2) > a > img"
},
"account links": {
"register": "#header-bar .account-links li:nth-child(1) > a",
Expand Down
18 changes: 9 additions & 9 deletions tests/exred/pages/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

GET_STARTED_BUTTON = ".triage a.button-cta"
CONTINUE_EXPORT_JOURNEY = ".triage a.button-cta"
NEW_TO_EXPORTING_LINK = "#personas > .container > .group div:nth-child(1) a"
OCCASIONAL_EXPORTER_LINK = "#personas > .container > .group div:nth-child(2) a"
REGULAR_EXPORTED_LINK = "#personas > .container > .group div:nth-child(3) a"
NEW_TO_EXPORTING_LINK = "#personas div:nth-child(1) > div > a"
OCCASIONAL_EXPORTER_LINK = "#personas div:nth-child(2) > div > a"
REGULAR_EXPORTED_LINK = "#personas div:nth-child(3) > div > a"
FIND_A_BUYER_SERVICE_LINK = "#services div:nth-child(1) > article > a"
ONLINE_MARKETPLACES_SERVICE_LINK = "#services div:nth-child(2) > article > a"
EXPORT_OPPORTUNITIES_SERVICE_LINK = "#services div:nth-child(3) > article > a"
Expand All @@ -36,12 +36,12 @@
CAROUSEL_THIRD_INDICATOR = ".ed-carousel__indicator[for='3']"
CASE_STUDIES_LINK = "#carousel h3 > a"
CASE_STUDY_LINK = "#carousel div.ed-carousel__slide:nth-child({}) h3 > a"
MARKET_RESEARCH_LINK = "#resource-guidance a[href='/market-research/']"
CUSTOMER_INSIGHT_LINK = "#resource-guidance a[href='/customer-insight/']"
FINANCE_LINK = "#resource-guidance a[href='/finance/']"
BUSINESS_LINK = "#resource-guidance a[href='/business-planning/']"
GETTING_PAID_LINK = "#resource-guidance a[href='/getting-paid/']"
OPERATIONS_AND_COMPLIANCE_LINK = "#resource-guidance a[href='/operations-and-compliance/']"
MARKET_RESEARCH_LINK = "#resource-guidance div:nth-child(1) > div > a"
CUSTOMER_INSIGHT_LINK = "#resource-guidance div:nth-child(2) > div > a"
FINANCE_LINK = "#resource-guidance div:nth-child(3) > div > a"
BUSINESS_LINK = "#resource-guidance div:nth-child(4) > div > a"
GETTING_PAID_LINK = "#resource-guidance div:nth-child(5) > div > a"
OPERATIONS_AND_COMPLIANCE_LINK = "#resource-guidance div:nth-child(6) > div > a"

SECTIONS = {
"video": {
Expand Down
4 changes: 1 addition & 3 deletions tests/smoke/test_buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def test_landing_page_post_company_not_found():
response = requests.post(
get_absolute_url('ui-buyer:landing'), data=data, allow_redirects=False
)
assert 'Company not found. Please check the number.' in str(
response.content
)
assert 'Error. Please try again later.' in str(response.content)


def test_landing_page_post_company_happy_path():
Expand Down