From b16d1c4811e918d7f80c0132992878f10eb07783 Mon Sep 17 00:00:00 2001
From: ramezsaeed <saeedr@incubaid.com>
Date: Wed, 18 Dec 2024 13:36:55 +0200
Subject: [PATCH] Development skip selenium failed tests (#3756)

* skip failed tests untill they got fixed

* add html view to the test report

* remove html view from test run result

* add html report view

* fix test_config_validation, Domain valiation message changed in the new release.

* skip home page failed tests

* fix tests in nodes and remove skip

* skip test twin_links

* fix missing import pytest

* fix codacy errors
---
 .../tests/frontend_selenium/tests/Farms/test_farm.py |  8 +++++++-
 .../tests/frontend_selenium/tests/Farms/test_node.py |  6 ++----
 .../frontend_selenium/tests/TFChain/test_bridge.py   |  6 ++++--
 .../frontend_selenium/tests/TFChain/test_homepage.py | 12 +++++-------
 .../frontend_selenium/tests/TFChain/test_twin.py     |  3 ++-
 .../tests/TFGrid/test_statistics.py                  |  3 ++-
 6 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/packages/playground/tests/frontend_selenium/tests/Farms/test_farm.py b/packages/playground/tests/frontend_selenium/tests/Farms/test_farm.py
index 9d28ff27f8..16da5aa249 100644
--- a/packages/playground/tests/frontend_selenium/tests/Farms/test_farm.py
+++ b/packages/playground/tests/frontend_selenium/tests/Farms/test_farm.py
@@ -2,6 +2,7 @@
 from pages.farm import FarmPage
 from utils.grid_proxy import GridProxy
 from pages.dashboard import DashboardPage
+import pytest
 
 #  Time required for the run (17 cases) is approximately 13 minutes.
 
@@ -16,6 +17,7 @@ def before_test_setup(browser):
     farm_page.navigetor()
     return farm_page, farm_name
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_create_farm(browser):
     """
     Test Case: TC907-Create farm with valid name
@@ -131,6 +133,7 @@ def test_create_farm_invalid_name(browser):
 #     assert id_up == sorted_up
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_farmpayout_address(browser):
     """
     Test Case: TC915 - Add farm payout address
@@ -175,6 +178,7 @@ def test_farmpayout_address(browser):
     assert farm_page.farmpayout_address_value()[:-3] in case
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_ip(browser):
     """
     Test Case: TC1141 - Enter valid IP
@@ -233,7 +237,7 @@ def test_ip(browser):
     assert farm_page.wait_for('IP is deleted successfully!')
     assert farm_page.get_ip(ip, gateway) == (0,0)
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_gateway(browser):
     """
     Test Case: TC1142 - Enter valid Gateway
@@ -265,6 +269,7 @@ def test_gateway(browser):
     farm_page.close_ip()
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_range_ips(browser):
     """
     Test Case: TC1212 - Enter invalid to IP in add range of IPs
@@ -354,6 +359,7 @@ def test_range_ips(browser):
     assert farm_page.get_ip(gateway, 0) == (2,0)
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3676")
 def test_farm_details(browser):
     """
     Test Case: TC914 - Farm Details
diff --git a/packages/playground/tests/frontend_selenium/tests/Farms/test_node.py b/packages/playground/tests/frontend_selenium/tests/Farms/test_node.py
index 872911cb20..c7485c8a4c 100644
--- a/packages/playground/tests/frontend_selenium/tests/Farms/test_node.py
+++ b/packages/playground/tests/frontend_selenium/tests/Farms/test_node.py
@@ -7,6 +7,7 @@
 import math
 import time
 
+
 #  Time required for the run (12 cases) is approximately 3 minutes.
 
 def before_test_setup(browser):
@@ -179,10 +180,9 @@ def test_config_validation(browser):
     cases = [generate_inavalid_ip(), generate_inavalid_gateway(), generate_string(), generate_leters(), '     ', '.', '/', 'q', '1', 'ww', 'ww/ww', '22.22']
     for case in cases:
         node_page.add_config_input( 0, 0, 0, 0, case)
-        assert node_page.wait_for('Wrong domain format.')
+        assert node_page.wait_for('Please provide a valid domain.')
         assert node_page.get_save_button().is_enabled()==False
 
-
 def test_add_config(browser):
     """
       Test Case: TC1221 - Add a public config
@@ -211,7 +211,6 @@ def test_add_config(browser):
             time.sleep(2)
     assert grid_proxy.get_node_ipv4(node_id) == new_ipv4
 
-
 def test_remove_config(browser):
     """
       Test Case: TC1222 - Remove a public config
@@ -239,7 +238,6 @@ def test_remove_config(browser):
             time.sleep(2)
     assert grid_proxy.get_node_ipv4(node_id) == ''
 
-
 def test_additional_fee(browser):
     """
       Test Case: TC1750 - Additional Fee
diff --git a/packages/playground/tests/frontend_selenium/tests/TFChain/test_bridge.py b/packages/playground/tests/frontend_selenium/tests/TFChain/test_bridge.py
index e99012cadf..bbb12a7b4c 100644
--- a/packages/playground/tests/frontend_selenium/tests/TFChain/test_bridge.py
+++ b/packages/playground/tests/frontend_selenium/tests/TFChain/test_bridge.py
@@ -2,6 +2,7 @@
 from pages.dashboard import DashboardPage
 from utils.grid_proxy import GridProxy
 from pages.bridge import BridgePage
+import pytest
 
 #  Time required for the run (11 cases) is approximately 3 minutes.
 
@@ -115,6 +116,7 @@ def test_check_deposit(browser):
     assert grid_proxy.get_twin_address(twin_id[twin_id.find('_')+1:]) == user_address
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3752")
 def test_check_withdraw_stellar(browser):
     """
       Test Case: TC1118 check withdraw stellar
@@ -156,7 +158,7 @@ def test_check_withdraw_invalid_stellar(browser):
     assert bridge_page.check_withdraw_invalid_stellar('') == False
     assert bridge_page.wait_for('This field is required')
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3752")
 def test_check_withdraw_tft_amount(browser):
     """
       Test Case: TC1131 check withdraw tft amount
@@ -204,7 +206,7 @@ def test_check_withdraw_invalid_tft_amount(browser):
     assert bridge_page.check_withdraw_invalid_tft_amount('') == False
     assert bridge_page.wait_for('This field is required')
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3752")
 def test_check_withdraw(browser):
     """
       Test Case: TC1132 check withdraw 
diff --git a/packages/playground/tests/frontend_selenium/tests/TFChain/test_homepage.py b/packages/playground/tests/frontend_selenium/tests/TFChain/test_homepage.py
index 217620918e..8cfb1b3604 100644
--- a/packages/playground/tests/frontend_selenium/tests/TFChain/test_homepage.py
+++ b/packages/playground/tests/frontend_selenium/tests/TFChain/test_homepage.py
@@ -3,6 +3,7 @@
 from pages.dashboard import DashboardPage
 from utils.utils import generate_string, get_seed, get_email
 from utils.base import Base
+import pytest
 
 #  Time required for the run (12 cases) is approximately 2 minutes.
 
@@ -24,11 +25,7 @@ def test_validate_homepage_links(browser):
     """
     dashboard_page = before_test_setup(browser)
     assert dashboard_page.navigate_to_find_more() == ('https://threefold.io/')
-    if Base.net == 'main':
-        stats_url = 'https://stats.grid.tf/'
-    else:
-        stats_url = 'https://stats.' + Base.net + '.grid.tf/'
-    assert dashboard_page.navigate_to_explore_capacity() == ( stats_url )
+    assert dashboard_page.navigate_to_explore_capacity() == ( 'https://stats.' + Base.net + '.grid.tf/')
     assert dashboard_page.navigate_to_learn_about_grid() == ('https://www.manual.grid.tf/')
 
 
@@ -53,6 +50,7 @@ def test_tft_price(browser):
     assert 0.99 < tft_in_usd * usd_in_tft < 1.1
 
 
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3753")
 def test_stats(browser):
     """
       Test Case: TC1674 - TFT stats
@@ -120,7 +118,7 @@ def test_create_account(browser):
     dashboard_page.logout_account()
     assert dashboard_page.wait_for_button(dashboard_page.login_account(password)).is_enabled() == True
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3753")
 def test_account_validation(browser):
     """
       Test Cases: TC1777 - Connect your wallet Validation
@@ -169,7 +167,7 @@ def test_account_validation(browser):
     assert dashboard_page.wait_for('Password is required')
     assert dashboard_page.wait_for_button(dashboard_page.login_account('123456')).is_enabled() == True
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3753")
 def test_login_links(browser):
     """
       Test Case: TC1801 - Verify login profile manager links
diff --git a/packages/playground/tests/frontend_selenium/tests/TFChain/test_twin.py b/packages/playground/tests/frontend_selenium/tests/TFChain/test_twin.py
index 3b53f93e46..b70b6ce8d3 100644
--- a/packages/playground/tests/frontend_selenium/tests/TFChain/test_twin.py
+++ b/packages/playground/tests/frontend_selenium/tests/TFChain/test_twin.py
@@ -2,6 +2,7 @@
 from pages.twin import TwinPage
 from utils.grid_proxy import GridProxy
 from pages.dashboard import DashboardPage
+import pytest
 
 #  Time required for the run (6 cases) is approximately 3 minutes.
 
@@ -78,7 +79,7 @@ def test_get_tft(browser):
     # NO checking as devnet don't direct to TF Connect page https://gettft.com/auth/login?next_url=/gettft/shop/#/buy
     assert twin_page.press_locked_info() == 'https://www.manual.grid.tf/documentation/developers/tfchain/tfchain.html#contract-locking'
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3751")
 def test_twin_links(browser):
     """
       Test Case: TC1801 - Verify your profile links
diff --git a/packages/playground/tests/frontend_selenium/tests/TFGrid/test_statistics.py b/packages/playground/tests/frontend_selenium/tests/TFGrid/test_statistics.py
index 5be61dab99..54e296ea7b 100644
--- a/packages/playground/tests/frontend_selenium/tests/TFGrid/test_statistics.py
+++ b/packages/playground/tests/frontend_selenium/tests/TFGrid/test_statistics.py
@@ -1,4 +1,5 @@
 import math
+import pytest
 from utils.utils import byte_converter,convert_to_scaled_float
 from pages.statistics import StatisticsPage
 from utils.grid_proxy import GridProxy
@@ -11,7 +12,7 @@ def before_test_setup(browser):
     statistics_page.navigate()
     return statistics_page
 
-
+@pytest.mark.skip(reason="https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3751")
 def test_statistics_details(browser):
     """
       TC1503 - Verify Statistics