Skip to content

Commit

Permalink
fix hompepage tests (#3773)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezsaeed authored Jan 5, 2025
1 parent ac2b854 commit 3d4d6d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ class DashboardPage:
login_button = (By.XPATH, "//button[.//span[text()='Login']]")
login_password_input = (By.XPATH, "//label[text()='Password']/following-sibling::input")
accept_terms_condition_button = (By.XPATH, "//button[.//span[text()='Accept terms and conditions']]")
connect_manual_button = (By.XPATH, "//p[@class='mb-4 text-center']/a")
connect_google_button = (By.XPATH, "//a[@title='play-store']")
connect_apple_button = (By.XPATH, "//a[@title='app-store']")
connect_manual_button = (By.XPATH,"//*[contains(text(), 'Threefold Connect')]")
connect_google_button = (By.XPATH, "//a[@title='Threefold Connect on Google Play Store']")
connect_apple_button = (By.XPATH, "//a[@title='Threefold Connect on Apple App Store']")
iframe_load_label = (By.XPATH, "//*[contains(text(), 'THESE TERMS AND CONDITIONS')]")
mnemonic_input_reveal_button = (By.XPATH, "//i[@aria-label='Your Mnemonic appended action']")
mnemonic_login_label = (By.XPATH, "//label[text()='Your Mnemonic']/following-sibling::input")
email_login_label = (By.XPATH, "//label[text()='Email']/following-sibling::input")
id_login_label = (By.XPATH, "//label[text()='Twin ID']/following-sibling::input")
address_login_label = (By.XPATH, "//label[text()='Address']/following-sibling::input")
capacity_stats = (By.XPATH, "//p[contains(@class, 'text-center') and following-sibling::p[text()='Capacity']]")
capacity_stats = (By.XPATH, "//p[contains(@class, 'text-center') and following-sibling::p[text()='SSD Capacity']]")
nodes_stats = (By.XPATH, "//p[contains(@class, 'text-center') and following-sibling::p[text()='Nodes']]")
countries_stats = (By.XPATH, "//p[contains(@class, 'text-center') and following-sibling::p[text()='Countries']]")
cores_stats = (By.XPATH, "//p[contains(@class, 'text-center') and following-sibling::p[text()='Cores']]")
Expand Down Expand Up @@ -210,6 +210,7 @@ def manual_link(self):
WebDriverWait(self.browser, 30).until(EC.visibility_of_element_located(self.logout_button))
WebDriverWait(self.browser, 30).until(EC.presence_of_element_located(self.qr_code_img))
WebDriverWait(self.browser, 30).until(EC.element_to_be_clickable(self.connect_manual_button))
WebDriverWait(self.browser, 30).until(EC.element_to_be_clickable(self.manual_button))
WebDriverWait(self.browser, 30).until(EC.element_to_be_clickable(self.manual_button)).click()
return self.get_link()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from utils.base import Base
import pytest

# Time required for the run (12 cases) is approximately 2 minutes.
# Time required for the run (8 cases) is approximately 03:40 minutes.


def before_test_setup(browser):
Expand Down Expand Up @@ -50,7 +50,6 @@ 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
Expand Down Expand Up @@ -118,7 +117,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
Expand Down Expand Up @@ -153,7 +152,7 @@ def test_account_validation(browser):
assert dashboard_page.wait_for('Passwords should match')
dashboard_page.click_button(dashboard_page.connect_your_wallet(get_email(), '123456'))
dashboard_page.open_profile()
assert dashboard_page.manual_link() == 'https://www.manual.grid.tf/documentation/threefold_token/storing_tft/tf_connect_app.html'
assert dashboard_page.manual_link() == 'https://www.manual.grid.tf/documentation/dashboard/wallet_connector.html'
assert dashboard_page.get_mnemonic() == get_seed()
assert dashboard_page.get_email() == get_email()
assert grid_proxy.get_twin_address(dashboard_page.get_id()) == dashboard_page.get_address()
Expand All @@ -167,7 +166,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
Expand All @@ -183,6 +182,7 @@ def test_login_links(browser):
dashboard_page.import_account(get_seed())
dashboard_page.click_button(dashboard_page.connect_your_wallet(get_email(), password))
dashboard_page.open_profile()
assert dashboard_page.manual_link() == 'https://www.manual.grid.tf/documentation/dashboard/wallet_connector.html'
assert dashboard_page.connect_manual_link() == 'https://www.manual.grid.tf/documentation/threefold_token/storing_tft/tf_connect_app.html'
assert dashboard_page.get_connect_google_link() == 'https://play.google.com/store/apps/details?id=org.jimber.threebotlogin&hl=en&gl=US'
assert dashboard_page.get_connect_apple_link() == 'https://apps.apple.com/us/app/threefold-connect/id1459845885'
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_stats_capicity(self):
stats_url = 'https://stats.' + Base.net + '.grid.tf/api/stats-summary'
r = requests.post(stats_url, timeout=10)
stats_json = r.json()
return list(stats_json.values())
return list(stats_json.values())[1::] #Avoid selecting HDD capacity; as its not shown in the dashboard anymore.

def get_stats(self):
up = requests.get(Base.gridproxy_url + 'stats?status=up', timeout=10).json()
Expand Down

0 comments on commit 3d4d6d5

Please sign in to comment.