def test_biodiverse_3_fail(self): # Fails due to bad threshold selected homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) experiment_page = homepage.click_experiments() # First create an SDM experiment to work with: new_sdm_page = experiment_page.click_new_sdm_experiment() sdm_experiment_name = create_sdm(self, new_sdm_page) # Click on Experiments experiment_page = homepage.click_experiments() # New projection experiment new_projection_page = experiment_page.click_new_projection_experiment() projection_experiment_name = create_projection(self, sdm_experiment_name, new_projection_page) # Click on Experiments experiment_page = homepage.click_experiments() # New biodiverse experiment new_biodiverse_page = experiment_page.click_new_biodiverse_experiment() # generate a unique identifier for the projection experiment biodiverse_experiment_name = "biodiverse_" + generate_timestamp() new_biodiverse_page.enter_experiment_name(biodiverse_experiment_name) new_biodiverse_page.enter_experiment_description("This is a biodiverse experiment") # select the earlier generated projection experiment new_biodiverse_page.select_source_projection_tab() new_biodiverse_page.select_projection_experiments(projection_experiment_name) new_biodiverse_page.select_species("Phascolarctus cinereus") new_biodiverse_page.select_years("2015") new_biodiverse_page.select_layers("proj_RCP3PD_gfdl-cm20_2015_Phascolarctus.cinereus.tif") # select the configuration tab new_biodiverse_page.select_configuration_tab() new_biodiverse_page.select_threshold_value("KAPPA") new_biodiverse_page.select_cluster_size("20000") # run the experiment new_biodiverse_page.select_run() experiment_result_page = new_biodiverse_page.select_run_experiment() experiment_result_page.wait_for_experiment_to_complete() self.assertTrue(experiment_result_page.has_completed_with_failure()) # Check results self.assertTrue(experiment_result_page.has_results_header(biodiverse_experiment_name)) self.assertTrue(experiment_result_page.has_result_file("proj_RCP3PD_gfdl-cm20_2015_Phascolarctus.cinereus.tif")) self.assertTrue(experiment_result_page.has_result_file("biodiverse.plout")) self.assertTrue(experiment_result_page.has_result_file("pstats.json")) # Cleanup self.delete_experiment(sdm_experiment_name) self.delete_experiment(projection_experiment_name) self.delete_experiment(biodiverse_experiment_name)
def test_sharing_experiment(self): homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) experiment_page = homepage.click_experiments() new_sdm_page = experiment_page.click_new_sdm_experiment() experiment_name = "sharing_test_" + generate_timestamp() new_sdm_page.enter_experiment_name(experiment_name) new_sdm_page.enter_experiment_description('Artificial Neural Network with Koala occurrences') new_sdm_page.select_configuration() new_sdm_page.select_sdm_algorithm('Artificial Neural Network') new_sdm_page.select_occurrences() new_sdm_page.select_occurrences_dataset('Koala - Mini occurrence dataset for Redland City') new_sdm_page.select_absences() new_sdm_page.select_absences_dataset('Koala - Mini absence dataset for Redland City') new_sdm_page.select_environment() new_sdm_page.select_current_climate_layers('30" (~1km)', 'Current climate layers for Redland City, 30" (~1km)') new_sdm_page.select_environmental_datasets('Current climate layers for Redland City, 30" (~1km)', 'B14 - Precipitation of Driest Month') new_sdm_page.select_run() experiment_view = new_sdm_page.select_review_start_experiment() # Wait until completion experiment_view.wait_for_experiment_to_complete() self.assertTrue(experiment_view.has_completed_successfully()) # Navigate back to experiment list experiment_page = experiment_view.click_experiments() # Check it's in the list experiments = experiment_page.get_experiment_list() self.assertTrue(experiment_name.lower() in experiments[0], "Could not find SDM experment") # Share it sharing_page = experiment_page.click_share_experiment(experiment_name) sharing_page.check_can_view("Logged-in users") sharing_page.agree_to_terms_and_conditions() sharing_page.select_share_save() # Log out logged_out_homepage = homepage.click_logout() login_page = logged_out_homepage.click_login() login_page.valid_login("testuser", "Pass.123") experiment_page = homepage.click_experiments() experiments = experiment_page.get_experiment_list() self.assertTrue(experiment_name in experiments[0]) # Log out so we can delete it logged_out_homepage = homepage.click_logout("test user") login_page = logged_out_homepage.click_login() login_page.valid_login(self.username, self.password) # Cleanup self.delete_experiment(experiment_name)
def test_ensemble_SDM(self): homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) experiment_page = homepage.click_experiments() new_sdm_page = experiment_page.click_new_sdm_experiment() experiment_name = "ann_" + generate_timestamp() new_sdm_page.enter_experiment_name(experiment_name) new_sdm_page.enter_experiment_description('Artificial Neural Network with Koala occurrences') new_sdm_page.select_configuration() new_sdm_page.select_sdm_algorithm('Artificial Neural Network') new_sdm_page.select_occurrences() new_sdm_page.select_occurrences_dataset('Koala - Mini occurrence dataset for Redland City') new_sdm_page.select_absences() new_sdm_page.select_absences_dataset('Koala - Mini absence dataset for Redland City') new_sdm_page.select_environment() new_sdm_page.select_current_climate_layers('30" (~1km)', 'Current climate layers for Redland City, 30" (~1km)') new_sdm_page.select_environmental_datasets('Current climate layers for Redland City, 30" (~1km)', 'B14 - Precipitation of Driest Month') new_sdm_page.select_run() experiment_view = new_sdm_page.select_review_start_experiment() # Wait until completion experiment_view.wait_for_experiment_to_complete() self.assertTrue(experiment_view.has_completed_successfully()) experiments_page = experiment_view.click_experiments() new_ensemble_page = experiments_page.click_new_ensemble_experiment() new_ensemble_page.enter_experiment_name("Ensemble_" + generate_timestamp()) new_ensemble_page.enter_experiment_description("A description goes here.") new_ensemble_page.click_source_data() new_ensemble_page.select_dataset_type("sdm") # Choose the SDM from before new_ensemble_page.select_source_experiment(experiment_name) # Choose a file from that SDM experiment: new_ensemble_page.select_available_file("proj_current_Phascolarctus.cinereus.tif") new_ensemble_page.click_run() experiment_results = new_ensemble_page.click_start_experiment() experiment_results.wait_for_experiment_to_complete() self.assertTrue(experiment_results.has_completed_successfully())
def test_upload_species_dataset(self): homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) datasets_page = homepage.click_datasets() upload_page = datasets_page.select_dataset_upload() upload_page = upload_page.select_dataset_type("Species Dataset") upload_page.upload_file(os.getcwd() + "test.csv") upload_page.enter_dataset_title("species_dataset" + generate_timestamp()) upload_page.enter_dataset_description("bleh") upload_page.enter_scientific_name("bleh") upload_page.enter_taxon_id("bluh") upload_page.enter_common_name("bloop") upload_page.agree_to_terms_and_conditions() upload_page.submit()
def test_upload_futureclimate_layer(self): homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) datasets_page = homepage.click_datasets() upload_page = datasets_page.select_dataset_upload() upload_page = upload_page.select_dataset_type("Future Climate Layer") upload_page.upload_file(os.getcwd() + "test.csv") upload_page.enter_dataset_title("environmental_layer" + generate_timestamp()) upload_page.enter_dataset_description("blurp") #upload_page.select_type("continuous") upload_page.select_resolution("30\" (~1km)") upload_page.enter_start_date(1, 1, 2000, "wow") upload_page.enter_end_date(2, 2, 2001, "weo") upload_page.select_emission_scenario("RCP6") upload_page.select_global_climate_model("Coupled Global Climate Model (CGCM3)") upload_page.agree_to_terms_and_conditions() upload_page.submit()
def test_upload_species_trait(self): homepage = Homepage(self.driver) login_page = homepage.click_login() homepage = login_page.valid_login(self.username, self.password) datasets_page = homepage.click_datasets() upload_page = datasets_page.select_dataset_upload() upload_page = upload_page.select_dataset_type("Species Trait") upload_page.upload_file(os.getcwd() + "test.csv") dataset_title = "species_trait_test_" + generate_timestamp() upload_page.enter_dataset_title(dataset_title) upload_page.enter_dataset_description("Description") upload_page.agree_to_terms_and_conditions() datasets_page = upload_page.submit() # Retry while datasets page hasn't loaded. datasets = datasets_page.get_dataset_list() while (len(datasets) == 0): datasets = datasets_page.get_dataset_list() self.assertTrue(dataset_title in datasets)