diff options
Diffstat (limited to 'bitbake/lib/toaster/tests/functional/test_project_page.py')
-rw-r--r-- | bitbake/lib/toaster/tests/functional/test_project_page.py | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/tests/functional/test_project_page.py b/bitbake/lib/toaster/tests/functional/test_project_page.py index 28f1fcb68b..46a60c010c 100644 --- a/bitbake/lib/toaster/tests/functional/test_project_page.py +++ b/bitbake/lib/toaster/tests/functional/test_project_page.py | |||
@@ -493,3 +493,82 @@ class TestProjectPage(SeleniumFunctionalTestCase): | |||
493 | self._navigate_to_config_nav('softwarerecipestable', 4) | 493 | self._navigate_to_config_nav('softwarerecipestable', 4) |
494 | # check show rows(pagination) | 494 | # check show rows(pagination) |
495 | self._mixin_test_table_show_rows(table_selector='softwarerecipestable') | 495 | self._mixin_test_table_show_rows(table_selector='softwarerecipestable') |
496 | |||
497 | def test_machines_page(self): | ||
498 | """ Test Machine page | ||
499 | - Check if title "Compatible machines" is displayed | ||
500 | - Check search input | ||
501 | - Check "Select machine" button works | ||
502 | - Check "Add layer" button works | ||
503 | - Check Machine table feature(show/hide column, pagination) | ||
504 | """ | ||
505 | self._navigate_to_config_nav('machinestable', 5) | ||
506 | # check title "Compatible software recipes" is displayed | ||
507 | self.assertTrue("Compatible machines" in self.get_page_source()) | ||
508 | # Test search input | ||
509 | self._mixin_test_table_search_input( | ||
510 | input_selector='search-input-machinestable', | ||
511 | input_text='qemux86-64', | ||
512 | searchBtn_selector='search-submit-machinestable', | ||
513 | table_selector='machinestable' | ||
514 | ) | ||
515 | # check "Select machine" button works | ||
516 | rows = self.find_all('#machinestable tbody tr') | ||
517 | machine_to_select = rows[0] | ||
518 | select_btn = machine_to_select.find_element( | ||
519 | By.XPATH, | ||
520 | '//td[@class="add-del-layers"]' | ||
521 | ) | ||
522 | select_btn.click() | ||
523 | self.wait_until_visible('#config-nav') | ||
524 | project_machine_name = self.find('#project-machine-name') | ||
525 | self.assertTrue( | ||
526 | 'qemux86-64' in project_machine_name.text | ||
527 | ) | ||
528 | # check "Add layer" button works | ||
529 | self._navigate_to_config_nav('machinestable', 5) | ||
530 | # Search for a machine whit layer not in project | ||
531 | self._mixin_test_table_search_input( | ||
532 | input_selector='search-input-machinestable', | ||
533 | input_text='qemux86-64-screen', | ||
534 | searchBtn_selector='search-submit-machinestable', | ||
535 | table_selector='machinestable' | ||
536 | ) | ||
537 | rows = self.find_all('#machinestable tbody tr') | ||
538 | machine_to_add = rows[0] | ||
539 | add_btn = machine_to_add.find_element( | ||
540 | By.XPATH, | ||
541 | '//td[@class="add-del-layers"]' | ||
542 | ) | ||
543 | add_btn.click() | ||
544 | # check modal is displayed | ||
545 | self.wait_until_visible('#dependencies-modal') | ||
546 | list_dependencies = self.find_all('#dependencies-list li') | ||
547 | # click on add-layers button | ||
548 | add_layers_btn = self.driver.find_element( | ||
549 | By.XPATH, | ||
550 | '//form[@id="dependencies-modal-form"]//button[@class="btn btn-primary"]' | ||
551 | ) | ||
552 | add_layers_btn.click() | ||
553 | self.wait_until_visible('#change-notification') | ||
554 | change_notification = self.find('#change-notification') | ||
555 | self.assertTrue( | ||
556 | f'You have added {len(list_dependencies)+1} layers to your project: meta-tanowrt and its dependencies' in change_notification.text | ||
557 | ) | ||
558 | |||
559 | # check Machine table feature(show/hide column, pagination) | ||
560 | self._navigate_to_config_nav('machinestable', 5) | ||
561 | column_list = [ | ||
562 | 'description', | ||
563 | 'layer_version__get_vcs_reference', | ||
564 | 'layer_version__layer__name', | ||
565 | 'machinefile', | ||
566 | ] | ||
567 | self._mixin_test_table_edit_column( | ||
568 | 'machinestable', | ||
569 | 'edit-columns-button', | ||
570 | [f'checkbox-{column}' for column in column_list] | ||
571 | ) | ||
572 | self._navigate_to_config_nav('machinestable', 5) | ||
573 | # check show rows(pagination) | ||
574 | self._mixin_test_table_show_rows(table_selector='machinestable') | ||