Fix instance error with attribute cells.
Selenium read data faster than the data are loaded.
Added wait until element is visible.
Change-Id: I2975ea5836a898d113a2baaab6a8f9bf8af8d742
(cherry picked from commit b14958df8b
)
This commit is contained in:
parent
6d385a64e9
commit
e39b3e2bdb
|
@ -10,6 +10,7 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
import netaddr
|
import netaddr
|
||||||
|
from selenium.common import exceptions
|
||||||
from selenium.webdriver.common import by
|
from selenium.webdriver.common import by
|
||||||
|
|
||||||
from openstack_dashboard.test.integration_tests.pages import basepage
|
from openstack_dashboard.test.integration_tests.pages import basepage
|
||||||
|
@ -64,6 +65,11 @@ class InstancesPage(basepage.BaseNavigationPage):
|
||||||
FLAVOR_STEP_INDEX = 2
|
FLAVOR_STEP_INDEX = 2
|
||||||
NETWORKS_STEP_INDEX = 3
|
NETWORKS_STEP_INDEX = 3
|
||||||
|
|
||||||
|
_search_state_active = (
|
||||||
|
by.By.XPATH,
|
||||||
|
"//*[contains(@class,'normal_column')][contains(text(),'Active')]"
|
||||||
|
)
|
||||||
|
|
||||||
def __init__(self, driver, conf):
|
def __init__(self, driver, conf):
|
||||||
super().__init__(driver, conf)
|
super().__init__(driver, conf)
|
||||||
self._page_title = "Instances"
|
self._page_title = "Instances"
|
||||||
|
@ -155,6 +161,10 @@ class InstancesPage(basepage.BaseNavigationPage):
|
||||||
row = self._get_row_with_instance_name(name)
|
row = self._get_row_with_instance_name(name)
|
||||||
return row and row.cells[self.INSTANCES_TABLE_STATUS_COLUMN]
|
return row and row.cells[self.INSTANCES_TABLE_STATUS_COLUMN]
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.wait_until_element_is_visible(self._search_state_active)
|
||||||
|
except exceptions.TimeoutException:
|
||||||
|
return False
|
||||||
status = self.instances_table.wait_cell_status(cell_getter,
|
status = self.instances_table.wait_cell_status(cell_getter,
|
||||||
('Active', 'Error'))
|
('Active', 'Error'))
|
||||||
return status == 'Active'
|
return status == 'Active'
|
||||||
|
|
Loading…
Reference in New Issue