Exemple #1
0
def test_transition_previously_created_new_feature_issue_to_other_states_with_a_resolution_for_appropriate_states(
):
    """
        transition a newly created issue through many states
    """
    jp = JiraProxy(VANILLA_SERVER_REGULAR_USER_CONFIG)
    status_items = jp.getStatuses(VANILLA_SERVER_REGULAR_USER_CONFIG)
    #print("\nStatus values for the NFI project")
    #for status in status_items:
    #    print(f'...   {status}')

    nf_item = jp.getIssue(STATIC_NEW_FEATURE_ITEM)
    #print(f"Current state: {nf_item.Status}     Resolution: |{nf_item.Resolution}|")
    transitions = jp.getTransitions(nf_item.key)
    #for next_state, trans_info in transitions.items():
    #    print(next_state, trans_info)

    #print(f"\n {nf_item.key} Status Transitions:")
    for new_state in expected_results:
        #print(f'Updating current status {nf_item.Status} to {new_state}')
        if nf_item.Status == new_state:
            #print(f'... skipping status update, new_status same as current status {nf_item.Status}')
            continue
        nf_item = jp.transitionIssueState(nf_item.key,
                                          new_state,
                                          resolution=None)
        #print(f'...   transitioned Issue.Status is now {nf_item.Status}')
        assert nf_item.Status == new_state
def test_list_transitions_for_newly_created_issue_by_regular():
    """
        list transitions that an newly created issue can use 
        with getTransitions as a regular user
    """
    jp = JiraProxy(GOOD_VANILLA_SERVER_REG_USER_CONFIG)
    work_item = {"Summary" :  "Elitch Gardens is just OK."}
    issue_key = jp.createIssue(PROJECT_KEY_1, "Bug", work_item)
    transitions = jp.getTransitions(issue_key)
    # If the PROJECT_KEY_4 is used the following lines would work
    #assert "Start Progress"  in transitions.keys()
    #assert "Resolve Issue"   in transitions.keys()
    #assert "Start Progress"  in transitions.keys()
    assert "To Do"       in transitions.keys()
    assert jp.deleteIssue(issue_key)
def test_list_transitions_for_newly_created_issue_by_admin_user():
    """
        list transitions that an newly created issue can use 
        with getTransitions as a admin user
    """
    jp = JiraProxy(GOOD_VANILLA_SERVER_CONFIG)
    work_item = {"Summary" : "Disneyland is great."}
    issue_key = jp.createIssue(PROJECT_KEY_1, "Bug", work_item)
    transitions = jp.getTransitions(issue_key)
    # If the PROJECT_KEY_4 is used the following lines would work
    #assert "Start Progress"  in transitions.keys()
    #assert "Resolve Issue"   in transitions.keys()
    #assert "Close Issue"     in transitions.keys()
    assert "To Do"       in transitions.keys()
    assert "In Progress" in transitions.keys()
    #assert "In Review"   in transitions.keys()   The default simplified workflow doesn't have this
    assert "Done"        in transitions.keys()
    assert jp.deleteIssue(issue_key)