コード例 #1
0
def test_delete_application(application):
    """
    Test01 -08
    Delete uploaded application file and check if next button gets disabled
    """
    project_name = fauxfactory.gen_alphanumeric(12, start="project_")
    project_collection = application.collections.projects
    view = navigate_to(project_collection, "Add")
    view.create_project.fill({"name": project_name, "description": "desc"})

    env = conf.get_config("env")
    fs = FTPClientWrapper(env.ftpserver.entities.rhamt)
    file_path = fs.download("acmeair-webapp-1.0-SNAPSHOT.war")

    view.add_applications.upload_file.fill(file_path)
    view.add_applications.next_button.wait_displayed()
    view.add_applications.delete_application.click()

    view.add_applications.confirm_delete.wait_displayed()
    view.add_applications.confirm_delete.click()

    view.add_applications.next_button.wait_displayed()
    assert not view.add_applications.next_button.is_enabled
    view.add_applications.back_button.wait_displayed()
    view.add_applications.back_button.click()
    view.add_applications.cancel_button.wait_displayed()
    view.add_applications.cancel_button.click()
コード例 #2
0
def test_project_crud(application):
    project_name = fauxfactory.gen_alphanumeric(12, start="project_")
    project_collection = application.collections.projects
    # TO DO paramterize the test later for file_name and trans_path, hardcoding for now
    project = project_collection.create(
        name=project_name,
        description=fauxfactory.gen_alphanumeric(start="desc_"),
        app_list=["acmeair-webapp-1.0-SNAPSHOT.war"],
        transformation_path="Containerization",
    )
    assert project.exists

    # Edit Project with no change , clicks cancel
    project.update({"name": project_name})
    assert project.name == project_name

    # Edit Project with new desc and save
    updated_name = fauxfactory.gen_alphanumeric(12, start="edited_")
    update_descr = "my edited description"
    with update(project):
        project.name = updated_name
        project.description = update_descr

    assert project.exists
    view = navigate_to(project.parent, "All")
    # check name and description both updated on UI or not
    proj = view.projects.get_project(project.name)
    assert proj.name == updated_name
    assert proj.description == update_descr

    # Delete project
    project.delete()
    assert not project.exists
コード例 #3
0
 def select_none(self):
     """ Delete all application to be analysed
     Args:
         app_name: Application
     """
     view = navigate_to(self, "AnalysisConfiguration")
     view.select_none.click()
     assert view.select_app_msg.is_displayed()
コード例 #4
0
 def delete_application(self, app_name):
     """ Delete application to be analysed
     Args:
         app_name: Application
     """
     view = navigate_to(self, "AnalysisConfigurationPage")
     view.selected_applications.delete_application(app_name)
     view.save_and_run_button.click()
コード例 #5
0
 def all(self):
     """Return all projects instance of Project class"""
     view = navigate_to(self, "All")
     if view.is_empty:
         return []
     else:
         return [
             self.instantiate(name=p.name, description=p.description)
             for p in view.projects.projects
         ]
コード例 #6
0
 def update(self, updates):
     view = navigate_to(self, "Edit")
     changed = view.fill(updates)
     if changed:
         view.update_project_button.click()
     else:
         view.cancel_button.click()
     view = self.create_view(AllProjectView, override=updates)
     view.wait_displayed()
     assert view.is_displayed
コード例 #7
0
    def delete(self, cancel=False, wait=False):
        """
        Args:
            cancel: cancel deletion
            wait: wait for delete
        """
        view = navigate_to(self, "Delete")
        view.fill({"delete_project_name": self.name})

        if cancel:
            view.cancel_button.click()
        else:
            view.delete_button.click()
            if wait:
                wait_for(lambda: not self.exists, delay=5, timeout=30)
コード例 #8
0
    def create(self,
               name,
               description=None,
               app_list=None,
               transformation_path=None):
        """Create a new project.

        Args:
            name: The name of the project
            description: The description of the project
            app_list: Applications to be analyzed
            transformation_path: transformation_path
        """
        view = navigate_to(self, "Add")
        view.create_project.fill({"name": name, "description": description})
        view.add_applications.wait_displayed()
        view.add_applications.fill({"app_list": app_list})
        view.configure_analysis.wait_displayed()
        view.configure_analysis.fill(
            {"transformation_path": transformation_path})

        project = self.instantiate(
            name=name,
            description=description,
            app_list=app_list,
            transformation_path=transformation_path,
        )
        view = self.create_view(AnalysisResultsView)
        view.wait_displayed()
        assert view.is_displayed
        wait_for(lambda: view.analysis_results.in_progress(),
                 delay=0.2,
                 timeout=120)
        wait_for(lambda: view.analysis_results.is_analysis_complete(),
                 delay=0.2,
                 timeout=120)
        assert view.analysis_results.is_analysis_complete()
        return project
コード例 #9
0
def test_login(application):
    """Test login nav destination"""
    view = navigate_to(application.collections.base, "LoggedIn")
    assert view.is_displayed
コード例 #10
0
 def exists(self):
     """Check project exist or not"""
     view = navigate_to(self.parent, "All")
     return False if view.is_empty else self.name in view.projects.items