Skip to content

Commit

Permalink
Make test fail for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jantoun-scottlogic committed Jun 25, 2024
1 parent e071c06 commit 9d103f0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions playwright/tests/test_0_TrialTest_HappyPath.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,36 @@

# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads


def test_example(page: Page) -> None:
# page.goto("http://localhost:57056/")
page.goto("http://localhost:4200/")
page.set_viewport_size({"width": 1920, "height": 1200})

# page.pause()
expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible()
expect(page.get_by_label("How many employees are in the")).to_have_value("100");
expect(page.get_by_label("How many employees are in the")).to_have_value("200")
expect(page.get_by_text("Desktops 50%")).to_be_visible()
page.get_by_text("Laptops 50%").click()
expect(page.get_by_role("heading", name="On-Premise Servers")).to_be_visible()
expect(page.get_by_label("Number of Servers:")).to_have_value("10");
expect(page.get_by_label("Where are they primarily")).to_have_value("WORLD");
expect(page.get_by_label("Number of Servers:")).to_have_value("10")
expect(page.get_by_label("Where are they primarily")).to_have_value("WORLD")
expect(page.get_by_role("heading", name="Cloud Services")).to_be_visible()
expect(page.get_by_text("Cloud 50%")).to_be_visible()
expect(page.get_by_text("On-premise 50%")).to_be_visible()
expect(page.get_by_label("Where are your cloud servers")).to_have_value("WORLD");
expect(page.get_by_label("What is your monthly cloud")).to_have_value("0: Object");
expect(page.get_by_label("Where are your cloud servers")).to_have_value("WORLD")
expect(page.get_by_label("What is your monthly cloud")).to_have_value("0: Object")
expect(page.get_by_role("heading", name="Users")).to_be_visible()
expect(page.get_by_text("Where are your end-users")).to_be_visible()
expect(page.get_by_label("Where are your end-users")).to_have_value("WORLD");
expect(page.get_by_label("Where are your end-users")).to_have_value("WORLD")
expect(page.get_by_text("How many monthly active users")).to_be_visible()
expect(page.get_by_label("How many monthly active users")).to_have_value("100");
expect(page.get_by_label("How many monthly active users")).to_have_value("100")
expect(page.get_by_text("Mobile 50%")).to_be_visible()
expect(page.get_by_text("Computer 50%")).to_be_visible()
expect(page.get_by_text("What's the primary purpose of your")).to_be_visible()
expect(page.get_by_label("What's the primary purpose of your")).to_have_value("average");
expect(page.get_by_label("What's the primary purpose of your")).to_have_value(
"average"
)
page.get_by_role("button", name="Calculate").click()
expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 33%")
expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 65%")
Expand Down

0 comments on commit 9d103f0

Please sign in to comment.