def test_incompatible_type( self, website, wait, shifter, legitimate_reference_runs, legitimate_types ): try_to_login_user(website, SHIFTER1_USERNAME, PASSWORD) wait_until(website.find_element_by_link_text, "Add Run").click() wait_until( Select(website.find_element_by_id("id_type")).select_by_visible_text, "Express Cosmics 3.8 T Cosmics Cosmics " "/StreamExpressCosmics/Run2018D-Express-v1/DQMIO", ) wait_until(website.find_element_by_id, "id_match_type").click() wait_until( Select( website.find_element_by_id("id_reference_run") ).select_by_visible_text, "300100 Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) fill_form_with_data(website) website.find_element_by_id("id_submit_add_run").click() dismiss_alert_popup(website) alert_text = wait_until(website.find_element_by_class_name, "alert").text assert "Reference run is incompatible with selected Type" in alert_text
def test_can_update_certification( self, website, shifter, legitimate_reference_runs, legitimate_types, some_checklists, wait, ): try_to_login_user(website, SHIFTER1_USERNAME, PASSWORD) wait_until(website.find_element_by_link_text, "Add Run") website.find_element_by_link_text("Add Run").click() check_all_checklists(website, wait) fill_and_submit_add_run_form(website) dismiss_alert_popup(website) wait_until(website.find_element_by_link_text, "Add Run") wait_for_cell(website, "456789", MAX_WAIT=60) website.find_elements_by_class_name("edit_run")[1].find_element_by_tag_name( "a" ).click() wait.until(EC.presence_of_element_located((By.ID, "id_run_number"))) website.find_element_by_id("id_run_number").click() website.find_element_by_id("id_run_number").clear() website.find_element_by_id("id_run_number").send_keys("555789") website.find_element_by_id("id_submit_add_run").click() dismiss_alert_popup(website) wait_until(website.find_element_by_link_text, "Add Run") wait_for_cell(website, "555789", MAX_WAIT=60)
def test_create_new_certification_when_no_checklist_exists( self, firefox, live_server, shifter, some_certified_runs, wait ): firefox.get("%s" % live_server.url) try_to_login_user(firefox, SHIFTER1_USERNAME, PASSWORD) wait_until(firefox.find_element_by_link_text, "Add Run").click() fill_and_submit_add_run_form(firefox) dismiss_alert_popup(firefox) wait_until(firefox.find_element_by_link_text, "Add Run") wait_for_cell(firefox, "456789", MAX_WAIT=60)
def test_create_certification_lowstat( self, website, shifter, some_certified_runs, wait ): try_to_login_user(website, SHIFTER1_USERNAME, PASSWORD) wait_until(website.find_element_by_link_text, "Add Run").click() select_types_and_reference_runs_in_form(website) website.find_element_by_id("id_pixel_lowstat").click() website.find_element_by_id("id_sistrip_lowstat").click() website.find_element_by_id("id_tracking_lowstat").click() fill_form_with_data( website, {"pixel": "Bad", "sistrip": "Good", "tracking": "Excluded"} ) website.find_element_by_id("id_submit_add_run").click() dismiss_alert_popup(website) wait_for_cell(website, "456789", MAX_WAIT=60) pixel = website.find_element_by_css_selector("td.pixel").get_attribute( "innerHTML" ) sistrip = website.find_element_by_css_selector("td.sistrip").get_attribute( "innerHTML" ) tracking = website.find_element_by_css_selector("td.tracking").get_attribute( "innerHTML" ) assert "bad-component" in pixel assert "Lowstat" in pixel assert "good-component" in sistrip assert "Lowstat" in sistrip assert "excluded-component" in tracking assert "Excluded" in tracking website.find_elements_by_class_name("edit_run")[1].find_element_by_tag_name( "a" ).click() assert website.find_element_by_id("id_pixel_lowstat").is_selected() assert website.find_element_by_id("id_sistrip_lowstat").is_selected() assert not website.find_element_by_id("id_tracking_lowstat").is_selected() website.find_element_by_id("id_pixel_lowstat").click() website.find_element_by_id("id_sistrip_lowstat").click() website.find_element_by_id("id_submit_add_run").click() dismiss_alert_popup(website) wait_for_cell(website, "456789", MAX_WAIT=60) pixel = website.find_element_by_css_selector("td.pixel").get_attribute( "innerHTML" ) sistrip = website.find_element_by_css_selector("td.sistrip").get_attribute( "innerHTML" ) tracking = website.find_element_by_css_selector("td.tracking").get_attribute( "innerHTML" ) assert "bad-component" in pixel assert "Bad" in pixel assert "Lowstat" not in pixel assert "good-component" in sistrip assert "Good" in sistrip assert "Lowstat" not in pixel assert "excluded-component" in tracking assert "Excluded" in tracking
def test_no_duplicate_certifications( self, website, wait, shifter, legitimate_reference_runs, legitimate_types ): try_to_login_user(website, SHIFTER1_USERNAME, PASSWORD) wait_until(website.find_element_by_link_text, "Add Run").click() wait_until( Select(website.find_element_by_id("id_type")).select_by_visible_text, "Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) wait_until( Select( website.find_element_by_id("id_reference_run") ).select_by_visible_text, "300100 Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) fill_form_with_data(website, {"run_number": 301123}) website.find_element_by_id("id_submit_add_run").click() wait_until(website.find_element_by_link_text, "Add Run").click() wait_until( Select(website.find_element_by_id("id_type")).select_by_visible_text, "Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) wait_until( Select( website.find_element_by_id("id_reference_run") ).select_by_visible_text, "300101 Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) fill_form_with_data(website, {"run_number": 301123}) website.find_element_by_id("id_submit_add_run").click() dismiss_alert_popup(website) alert_text = wait_until(website.find_element_by_class_name, "alert").text assert ( "This run (301123, Collisions Express) was already " "certified by shifter1 on " in alert_text ) wait_until( Select( website.find_element_by_id("id_reference_run") ).select_by_visible_text, "300100 Express Collisions 3.8 T Proton-Proton 13 TeV " "/StreamExpress/Run2018A-Express-v1/DQMIO", ) alert_text = website.find_element_by_class_name("alert").text assert ( "This run (301123, Collisions Express) was already " "certified by shifter1 on " in alert_text ) website.find_element_by_id("id_run_number").clear() website.find_element_by_id("id_run_number").send_keys(301124) website.find_element_by_id("id_submit_add_run").click() wait_until(website.find_element_by_link_text, "Add Run")