diff --git a/playwright/tests/00_test_50_EstTool_TEMPLATE.py b/playwright/tests/00_test_50_EstTool_TEMPLATE.py deleted file mode 100644 index 7020517e..00000000 --- a/playwright/tests/00_test_50_EstTool_TEMPLATE.py +++ /dev/null @@ -1,68 +0,0 @@ -import re -from playwright.sync_api import Page, expect - -# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads -# OnPrem & Cloud Checked -# Calcs match spreadsheet - - -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() - - #Organisation - expect(page.get_by_label("How many employees are in the")).to_have_value("100"); - expect(page.get_by_text("What percentage of those")).to_be_visible() - expect(page.get_by_text("Desktops 50%")).to_be_visible() - expect(page.get_by_text("Laptops 50%")).to_be_visible() - - # On Prem Servers - expect(page.get_by_role("heading", name="On-Premise Servers")).to_be_visible() - expect(page.get_by_text("We'll use the number of")).to_be_visible() - expect(page.get_by_text("How many on-premise servers")).to_be_visible() - expect(page.locator("label").filter(has_text="I don't know")).to_be_visible() - # Check "I don't know" - page.get_by_label("I don't know").check() - expect(page.get_by_text("We'll make an assumption")).to_be_visible() - expect(page.get_by_text("Number of Servers:")).to_be_visible() - expect(page.get_by_label("Number of Servers:")).to_be_disabled() - expect(page.get_by_label("Where are they primarily")).to_have_value("global"); - - # Cloud - expect(page.get_by_role("heading", name="Cloud Services")).to_be_visible() - expect(page.get_by_text("Tell us about your cloud")).to_be_visible() - expect(page.get_by_text("We don't use cloud services")).to_be_visible() - # Check "We don't use cloud services" - expect(page.get_by_label("We don't use cloud services")).not_to_be_checked() - page.get_by_label("We don't use cloud services").check() - expect(page.get_by_label("We don't use cloud services")).to_be_checked() - expect(page.get_by_text("What percentage of your servers are cloud services vs on-premise?")).not_to_be_visible() - - # Users - expect(page.get_by_role("heading", name="Users")).to_be_visible() - expect(page.get_by_text("Tell us about your users. At")).to_be_visible() - expect(page.get_by_text("Where are your users")).to_be_visible() - expect(page.get_by_label("Where are your users")).to_have_value("global"); - 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_text("What percentage of your users")).to_be_visible() - 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 purpose of your")).to_be_visible() - expect(page.get_by_label("What's the purpose of your")).to_have_value("average"); - - # Calculate - page.get_by_role("button", name="Calculate").click() - expect(page.get_by_text("Upstream Emissions:")).to_be_visible() - expect(page.get_by_text("28%")).to_be_visible() - expect(page.get_by_text("Indirect Emissions:")).to_be_visible() - expect(page.get_by_text("0%", exact=True).first).to_be_visible() - expect(page.get_by_text("Direct Emissions:", exact=True)).to_be_visible() - expect(page.get_by_text("71%")).to_be_visible() - expect(page.get_by_text("Downstream Emissions:")).to_be_visible() - expect(page.get_by_text("1%", exact=True)).to_be_visible() - diff --git a/playwright/tests/test_10_EstTool_OnPremANDCloud_Checked_Comp_100.py b/playwright/tests/test_10_EstTool_OnPremANDCloud_Checked_Comp_100.py index d2794beb..b20d0e48 100644 --- a/playwright/tests/test_10_EstTool_OnPremANDCloud_Checked_Comp_100.py +++ b/playwright/tests/test_10_EstTool_OnPremANDCloud_Checked_Comp_100.py @@ -72,9 +72,9 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 25%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 72%") - expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - 3%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 32%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 64%") + expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - 5%") diff --git a/playwright/tests/test_11_EstTool_OneMillEmpl_Mix_Inputs.py b/playwright/tests/test_11_EstTool_OneMillEmpl_Mix_Inputs.py index 73258a42..226ecf9d 100644 --- a/playwright/tests/test_11_EstTool_OneMillEmpl_Mix_Inputs.py +++ b/playwright/tests/test_11_EstTool_OneMillEmpl_Mix_Inputs.py @@ -72,9 +72,9 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 28%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 71%") - expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 58%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 40%") + expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - 2%") expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") diff --git a/playwright/tests/test_12_EstTool_10Empl_Mix_Inputs.py b/playwright/tests/test_12_EstTool_10Empl_Mix_Inputs.py index 10218597..3524f58b 100644 --- a/playwright/tests/test_12_EstTool_10Empl_Mix_Inputs.py +++ b/playwright/tests/test_12_EstTool_10Empl_Mix_Inputs.py @@ -70,8 +70,8 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 29%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 71%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 30%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 70%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_13_EstTool_500Empl_Mix_Inputs.py b/playwright/tests/test_13_EstTool_500Empl_Mix_Inputs.py index 32a7691a..caaaefae 100644 --- a/playwright/tests/test_13_EstTool_500Empl_Mix_Inputs.py +++ b/playwright/tests/test_13_EstTool_500Empl_Mix_Inputs.py @@ -76,8 +76,8 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 22%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 78%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 25%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 75%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") @@ -100,10 +100,11 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 22%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 78%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 25%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 75%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + diff --git a/playwright/tests/test_14_EstTool_25KEmpl_Mix_Inputs.py b/playwright/tests/test_14_EstTool_25KEmpl_Mix_Inputs.py index 1dcdc28c..00e49445 100644 --- a/playwright/tests/test_14_EstTool_25KEmpl_Mix_Inputs.py +++ b/playwright/tests/test_14_EstTool_25KEmpl_Mix_Inputs.py @@ -74,10 +74,10 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 7%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 16%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 6%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 5%") expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") - expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - 77%") + expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - 89%") diff --git a/playwright/tests/test_15_EstTool_6kEmpl_Mix_Inputs.py b/playwright/tests/test_15_EstTool_6kEmpl_Mix_Inputs.py index 1cd2ea7f..4c3137d0 100644 --- a/playwright/tests/test_15_EstTool_6kEmpl_Mix_Inputs.py +++ b/playwright/tests/test_15_EstTool_6kEmpl_Mix_Inputs.py @@ -69,9 +69,9 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 24%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 72%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 3%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 35%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 59%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 6%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") @@ -82,5 +82,4 @@ def test_example(page: Page) -> None: - ############################################################################## \ No newline at end of file diff --git a/playwright/tests/test_16_EstTool_UI_QuestionMarks1.py b/playwright/tests/test_16_EstTool_UI_QuestionMarks1.py deleted file mode 100644 index d4ef9993..00000000 --- a/playwright/tests/test_16_EstTool_UI_QuestionMarks1.py +++ /dev/null @@ -1,31 +0,0 @@ -import re -from playwright.sync_api import Page, expect - -# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads -# Help icon "?" -# Ensure that text visible and link works - - -def test_example(page: Page) -> None: - # page.goto("http://localhost:57056/") - page.goto("http://localhost:4200/") - - page.set_viewport_size({"width": 1920, "height": 1200}) - expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible() - - #Organisation - expect(page.get_by_text("Desktops 50%")).to_be_visible() - - # 1st question mark (On Prem) - page.locator("div").filter(has_text=re.compile(r"^Where are they primarily located\? help_outline$")).get_by_role("button").click() - # expect(page.locator("#cdk-overlay-2")).to_contain_text("This will affect the average Carbon Intensity of the energy used by your servers.") - expect(page.locator("#cdk-overlay-0")).to_contain_text("This will affect the average Carbon Intensity of the energy used by your servers.") - expect(page.get_by_role("link")).to_contain_text("Carbon Intensity") - page.get_by_role("link", name="Carbon Intensity").click() - expect(page.get_by_role("link", name="Carbon Intensity", exact=True)).to_be_visible() - - - - - ############################################################################## - \ No newline at end of file diff --git a/playwright/tests/test_16_EstTool_UI_QuestionMarks2.py b/playwright/tests/test_16_EstTool_UI_QuestionMarks2.py deleted file mode 100644 index a6fc99da..00000000 --- a/playwright/tests/test_16_EstTool_UI_QuestionMarks2.py +++ /dev/null @@ -1,32 +0,0 @@ -import re -from playwright.sync_api import Page, expect - -# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads -# Help icon "?" -# Ensure that text visible and link works - - -def test_example(page: Page) -> None: - # page.goto("http://localhost:57056/") - page.goto("http://localhost:4200/") - - page.set_viewport_size({"width": 1920, "height": 1200}) - expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible() - - #Organisation - expect(page.get_by_text("Desktops 50%")).to_be_visible() - - # 2nd question mark (Cloud) - page.locator("div").filter(has_text=re.compile(r"^Where are your cloud servers primarily located\? help_outline$")).get_by_role("button").click() - expect(page.locator("#cdk-overlay-0")).to_contain_text("This will affect the average Carbon Intensity of the energy used by your cloud services.") - expect(page.get_by_role("link", name="Carbon Intensity")).to_be_visible() - page.get_by_role("link", name="Carbon Intensity").click() - expect(page.get_by_role("link", name="Carbon Intensity", exact=True)).to_be_visible() - expect(page.get_by_role("link", name="Carbon Neutral")).to_be_visible() - - - - - - ############################################################################## - \ No newline at end of file diff --git a/playwright/tests/test_16_EstTool_UI_QuestionMarks3.py b/playwright/tests/test_16_EstTool_UI_QuestionMarks3.py deleted file mode 100644 index 21c36509..00000000 --- a/playwright/tests/test_16_EstTool_UI_QuestionMarks3.py +++ /dev/null @@ -1,33 +0,0 @@ -import re -from playwright.sync_api import Page, expect - -# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads -# Help icon "?" -# Ensure that text visible and link works - - -def test_example(page: Page) -> None: - # page.goto("http://localhost:57056/") - page.goto("http://localhost:4200/") - - page.set_viewport_size({"width": 1920, "height": 1200}) - expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible() - - #Organisation - expect(page.get_by_text("Desktops 50%")).to_be_visible() - - # 3rd question mark (Cloud) - expect(page.locator("div").filter(has_text=re.compile(r"^Where are your users primarily located\? help_outline$")).get_by_role("button")).to_be_visible() - page.locator("div").filter(has_text=re.compile(r"^Where are your users primarily located\? help_outline$")).get_by_role("button").click() - expect(page.locator("#cdk-overlay-0")).to_contain_text("This will affect the average Carbon Intensity of the energy used by end-user devices and network infrastructure.") - page.get_by_role("link", name="Carbon Intensity").click() - expect(page.get_by_role("link", name="Carbon Intensity", exact=True)).to_be_visible() - expect(page.get_by_role("heading", name="Embodied Carbon").get_by_role("link")).to_be_visible() - - - - - - - ############################################################################## - \ No newline at end of file diff --git a/playwright/tests/test_16_EstTool_UI_QuestionMarks4.py b/playwright/tests/test_16_EstTool_UI_QuestionMarks4.py deleted file mode 100644 index 5c0d98ad..00000000 --- a/playwright/tests/test_16_EstTool_UI_QuestionMarks4.py +++ /dev/null @@ -1,31 +0,0 @@ -import re -from playwright.sync_api import Page, expect - -# This test is to check that the page loads, labels, scroll bars, dropdowns are all visible and set at the default when page loads -# Help icon "?" -# Ensure that text visible and link works - - -def test_example(page: Page) -> None: - # page.goto("http://localhost:57056/") - page.goto("http://localhost:4200/") - - page.set_viewport_size({"width": 1920, "height": 1200}) - expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible() - - # Organisation - expect(page.get_by_text("Desktops 50%")).to_be_visible() - - # 4th question mark (Users) - page.locator("div").filter(has_text="Organisation expand_less To").nth(1).click() - page.get_by_role("button", name="help_outline").nth(3).click() - expect(page.locator("#cdk-overlay-0")).to_contain_text("The percentage of mobile users will affect the energy used by end user devices and network infrastructure.While the power demand of mobile devices is often much lower, the use of mobile networks can increase the power used when transferring data.") - - - - - - - - ############################################################################## - \ No newline at end of file diff --git a/playwright/tests/test_18_EstTool_Cloud1Mil.py b/playwright/tests/test_18_EstTool_Cloud1Mil.py index 0ca6bb50..e12dbedb 100644 --- a/playwright/tests/test_18_EstTool_Cloud1Mil.py +++ b/playwright/tests/test_18_EstTool_Cloud1Mil.py @@ -69,8 +69,8 @@ def test_example(page: Page) -> None: page.get_by_role("button", name="Calculate").click() expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 11%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 22%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 67%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 9%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 80%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_2_EstTool_HappyPath_Default.py b/playwright/tests/test_2_EstTool_HappyPath_Default.py index c798e15e..abccfb09 100644 --- a/playwright/tests/test_2_EstTool_HappyPath_Default.py +++ b/playwright/tests/test_2_EstTool_HappyPath_Default.py @@ -52,7 +52,8 @@ def test_example(page: Page) -> None: page.get_by_label("Where are your cloud servers").select_option("WORLD") expect(page.get_by_text("We have derived a rough")).to_be_visible() expect(page.get_by_text("What is your monthly cloud")).to_be_visible() - page.get_by_label("What is your monthly cloud").select_option("5: Object") #$20-$50k + # page.get_by_label("What is your monthly cloud").select_option("5: Object") #$20-$50k + page.get_by_label("What is your monthly cloud").select_option("0: Object") # Users expect(page.get_by_role("heading", name="End-Users")).to_be_visible() @@ -63,10 +64,11 @@ def test_example(page: Page) -> None: expect(page.get_by_text("What's the primary purpose of")).to_be_visible() page.get_by_text("What's the primary purpose of").click() - page.get_by_label("What's the primary purpose of").select_option("socialMedia") + # page.get_by_label("What's the primary purpose of").select_option("socialMedia") + page.get_by_label("What's the primary purpose of").select_option("average") expect(page.get_by_text("Where are your end-users")).to_be_visible() page.get_by_label("Where are your end-users").select_option("GBR") - page.get_by_label("Where are your end-users").select_option("WORLD") + page.get_by_label("Where are your end-users").select_option("Globally") expect(page.get_by_text("How many monthly active users")).to_be_visible() page.get_by_label("How many monthly active users").click() page.get_by_label("How many monthly active users").fill("100") @@ -76,18 +78,17 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet + page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 22%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 49%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 34%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 33%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 65%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 1%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") - - + ############################################################################## - diff --git a/playwright/tests/test_3_EstTool_HappyPath_Reset.py b/playwright/tests/test_3_EstTool_HappyPath_Reset.py index bcd690db..ddb3b6d0 100644 --- a/playwright/tests/test_3_EstTool_HappyPath_Reset.py +++ b/playwright/tests/test_3_EstTool_HappyPath_Reset.py @@ -155,9 +155,9 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 25%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 73%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 33%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 65%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 1%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_4_EstTool_DesktopZero.py b/playwright/tests/test_4_EstTool_DesktopZero.py index 84c52299..da8e4449 100644 --- a/playwright/tests/test_4_EstTool_DesktopZero.py +++ b/playwright/tests/test_4_EstTool_DesktopZero.py @@ -82,8 +82,8 @@ def test_example(page: Page) -> None: # Calculate outcome and make sure it matches spreadsheet # page.pause() page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 30%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 68%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 32%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 66%") expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 1%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_5_EstTool_LaptopZero.py b/playwright/tests/test_5_EstTool_LaptopZero.py index efbe1af8..93317713 100644 --- a/playwright/tests/test_5_EstTool_LaptopZero.py +++ b/playwright/tests/test_5_EstTool_LaptopZero.py @@ -82,9 +82,9 @@ def test_example(page: Page) -> None: # Calculate outcome and make sure it matches spreadsheet # page.pause() page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 23%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 76%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 34%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 64%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 1%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_6_EstTool_OnPrem_DontKnow_Checked.py b/playwright/tests/test_6_EstTool_OnPrem_DontKnow_Checked.py index bfad57b4..e8f5680d 100644 --- a/playwright/tests/test_6_EstTool_OnPrem_DontKnow_Checked.py +++ b/playwright/tests/test_6_EstTool_OnPrem_DontKnow_Checked.py @@ -76,9 +76,9 @@ def test_example(page: Page) -> None: # Calculate outcome and make sure it matches spreadsheet # page.pause() page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 29%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 70%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 41%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 57%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 2%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_7_EstTool_OnPrem_DontKnow_Checked_ReCalc.py b/playwright/tests/test_7_EstTool_OnPrem_DontKnow_Checked_ReCalc.py index 94a0a6ea..91ddd568 100644 --- a/playwright/tests/test_7_EstTool_OnPrem_DontKnow_Checked_ReCalc.py +++ b/playwright/tests/test_7_EstTool_OnPrem_DontKnow_Checked_ReCalc.py @@ -121,9 +121,9 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 29%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 70%") - expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - <1%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 41%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 57%") + expect(page.locator("foreignobject")).to_contain_text("Indirect Emissions - 2%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_8_EstTool_OnPremANDCloud_Checked.py b/playwright/tests/test_8_EstTool_OnPremANDCloud_Checked.py index 8183e738..9c4bdc3c 100644 --- a/playwright/tests/test_8_EstTool_OnPremANDCloud_Checked.py +++ b/playwright/tests/test_8_EstTool_OnPremANDCloud_Checked.py @@ -60,8 +60,8 @@ def test_example(page: Page) -> None: # Calculate outcome and make sure it matches spreadsheet # page.pause() page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 26%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 74%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 33%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 66%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_9_EstTool_Cloud_Checked.py b/playwright/tests/test_9_EstTool_Cloud_Checked.py index b7df54e5..92ee6ec5 100644 --- a/playwright/tests/test_9_EstTool_Cloud_Checked.py +++ b/playwright/tests/test_9_EstTool_Cloud_Checked.py @@ -60,8 +60,8 @@ def test_example(page: Page) -> None: # Calculate # Calculate outcome and make sure it matches spreadsheet page.get_by_role("button", name="Calculate").click() - expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 26%") - expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 74%") + expect(page.locator("foreignobject")).to_contain_text("Upstream Emissions - 33%") + expect(page.locator("foreignobject")).to_contain_text("Direct Emissions - 66%") expect(page.locator("foreignobject")).to_contain_text("Downstream Emissions - <1%") diff --git a/playwright/tests/test_EstTool_ZeroEmpl_Fail.py b/playwright/tests/test_EstTool_ZeroEmpl_Fail.py deleted file mode 100644 index 80b13d06..00000000 --- a/playwright/tests/test_EstTool_ZeroEmpl_Fail.py +++ /dev/null @@ -1,17 +0,0 @@ -import re - -from playwright.sync_api import Page, expect - - -def test_example(page: Page) -> None: - page.goto("http://localhost:4200/") - expect(page.get_by_role("heading", name="Carbon Estimator")).to_be_visible() - expect(page.get_by_role("heading", name="Organisation")).to_be_visible() - expect(page.get_by_text("To understand the scale of")).to_be_visible() - expect(page.get_by_text("How many employees are in the")).to_be_visible() - expect(page.get_by_label("How many employees are in the")).to_be_visible() - page.get_by_label("How many employees are in the").click() - page.get_by_label("How many employees are in the").fill("0") - page.get_by_role("button", name="Calculate").click() - -