def test_coins_persists(player_wizard, browser): # noqa """As a player, all fields for coins persist after page refresh.""" print('As a player, all fields for coins persist after page refresh.') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() time.sleep(3) coins_table.platinum = 50 coins_table.gold = 50 coins_table.electrum = 50 coins_table.silver = 50 coins_table.copper = 50 coins_table.copper.send_keys(Keys.TAB) time.sleep(1) browser.refresh() time.sleep(3) assert coins_table.platinum.get_attribute('value').strip() == '50' assert coins_table.gold.get_attribute('value').strip() == '50' assert coins_table.electrum.get_attribute('value').strip() == '50' assert coins_table.silver.get_attribute('value').strip() == '50' assert coins_table.copper.get_attribute('value').strip() == '50'
def test_edit_coins(player_wizard, browser): # noqa """As a player, I can edit coins.""" print('As a player, I can delete coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() coins_table.platinum = 2 coins_table.gold = 4 coins_table.electrum = 6 coins_table.silver = 8 coins_table.copper = 10 assert coins_table.platinum.get_attribute('value').strip() == '2' assert coins_table.gold.get_attribute('value').strip() == '4' assert coins_table.electrum.get_attribute('value').strip() == '6' assert coins_table.silver.get_attribute('value').strip() == '8' assert coins_table.copper.get_attribute('value').strip() == '10' coins_table.platinum = 4 coins_table.gold = 6 coins_table.electrum = 8 coins_table.silver = 10 coins_table.copper = 12 assert coins_table.platinum.get_attribute('value').strip() == '4' assert coins_table.gold.get_attribute('value').strip() == '6' assert coins_table.electrum.get_attribute('value').strip() == '8' assert coins_table.silver.get_attribute('value').strip() == '10' assert coins_table.copper.get_attribute('value').strip() == '12'
def test_coins_total_weight(player_wizard, browser): # noqa """As a player, I can view total weight for coins.""" print('As a player, I can view total weight for coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() # For some reason if data loads too fast the values disapear # Something loading in the UI must cause the values to be removed time.sleep(2) coins_table.platinum = 50 coins_table.gold = 50 coins_table.electrum = 50 coins_table.silver = 50 coins_table.copper = 49 coins_table.copper.send_keys(Keys.TAB) WebDriverWait(browser, DEFAULT_WAIT_TIME).until( EC.text_to_be_present_in_element( (By.ID, coins_table.total_weight_id), '4 (lbs)' ) ) assert coins_table.total_weight.text.strip() == '4 (lbs)'
def test_edit_coins(player_wizard, browser): # noqa """As a player, I can edit coins.""" print('As a player, I can delete coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() # For some reason if data loads too fast the values disapear # Something loading in the UI must cause the values to be removed time.sleep(2) coins_table.platinum = 2 coins_table.gold = 4 coins_table.electrum = 6 coins_table.silver = 8 coins_table.copper = 10 assert coins_table.platinum.get_attribute('value').strip() == '2' assert coins_table.gold.get_attribute('value').strip() == '4' assert coins_table.electrum.get_attribute('value').strip() == '6' assert coins_table.silver.get_attribute('value').strip() == '8' assert coins_table.copper.get_attribute('value').strip() == '10' coins_table.platinum = 4 coins_table.gold = 6 coins_table.electrum = 8 coins_table.silver = 10 coins_table.copper = 12 assert coins_table.platinum.get_attribute('value').strip() == '4' assert coins_table.gold.get_attribute('value').strip() == '6' assert coins_table.electrum.get_attribute('value').strip() == '8' assert coins_table.silver.get_attribute('value').strip() == '10' assert coins_table.copper.get_attribute('value').strip() == '12'
def test_coins_total_weight(player_wizard, browser): # noqa """As a player, I can view total weight for coins.""" print('As a player, I can view total weight for coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() coins_table.platinum = 50 coins_table.gold = 50 coins_table.electrum = 50 coins_table.silver = 50 coins_table.copper = '49\t' assert coins_table.total_weight.text == '4 (lbs)'
def test_worth_in_gold_coins(player_wizard, browser): # noqa """As a player, I can view total gold for coins.""" print('As a player, I can view total gold for coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() coins_table.platinum = 1 coins_table.gold = 1 coins_table.electrum = 2 coins_table.silver = 10 coins_table.copper = '100\t' assert coins_table.worth_in_gold.text == '14'
def test_worth_in_gold_coins(player_wizard, browser): # noqa """As a player, I can view total gold for coins.""" print('As a player, I can view total gold for coins') coins_table = coins.Coins(browser) tabs = Tabs(browser) tabs.inventory.click() # For some reason if data loads too fast the values disapear # Something loading in the UI must cause the values to be removed time.sleep(2) coins_table.platinum = 1 coins_table.gold = 1 coins_table.electrum = 2 coins_table.silver = 10 coins_table.copper = 100 coins_table.copper.send_keys(Keys.TAB) assert coins_table.worth_in_gold.text.strip() == '14'