Ejemplo n.º 1
0
    public void TestRequestManually(string id)
    {
        TestRequest r = new TestRequest(id);

        r.TESTER = CurrentContext.UserID;
        r.Store();
    }
Ejemplo n.º 2
0
    public static void UntestRequest(string id)
    {
        TestRequest tr = new TestRequest(id)
        {
            USERID = CurrentContext.UserID.ToString(), TESTED = ""
        };

        tr.Store();
    }
Ejemplo n.º 3
0
    public static void RunBatch4Request(string user, string batchname, string requestGUID, string priority)
    {
        TestRequest tr   = new TestRequest("", requestGUID);
        string      text = ParseChildBatches(strInput: (new Batch("", batchname)).BATCH_DATA);

        string[] Commands, arrGroup;
        GetCommandsGroups(text, out Commands, out arrGroup);
        Schedule.AddCommands(Commands, arrGroup, tr.ID.ToString(), (new BSTUser("", user)).ID.ToString(), priority);

        tr.REQUEST_PRIORITY = Convert.ToInt32(priority);
        tr.USERID           = (new BSTUser("", "bst")).ID.ToString();
        tr.Store();
    }
Ejemplo n.º 4
0
    public static void IgnoreRequest(string id, string str1or0)
    {
        bool        ignore = str1or0 == "1";
        TestRequest tr     = new TestRequest(id)
        {
            USERID = CurrentContext.UserID.ToString(), IGNORE = ignore ? "true" : ""
        };

        tr.Store();

        if (!ignore)
        {
            return;
        }

        string emal = tr.PROGABB;
        string ttid = tr.TTID;
        string comm = tr.COMMENT;

        Version v    = new Version(tr.VERSIONID);
        string  vers = v.VERSION;

        //----update TestTrack DB
        string tasknumber = Regex.Match(ttid.ToUpper(), "TT[0-9]+").Value.Replace("TT", "");

        if (!String.IsNullOrEmpty(tasknumber))
        {
            DefectConnector.UpdateDefect(tasknumber, "", CurrentContext.User.PHONE);
        }
        //----update end

        string body = string.Format(@"
		Your request to test version ({0}) was processed by {1}<br>
		Your version: <a href='http://{2}/runs.aspx?R.RequestID={3}'>{0}</a> will be <b>IGNORED</b><br>
		{4}<br>
		{5}<br><br>
		Person responsible: <b>{1}</b><br><br>
		Best regards, {1}
		"        , vers, CurrentContext.UserName(), Settings.CurrentSettings.BSTADDRESS, id, ttid, comm);

        AddEmail(
            emal
            , string.Format("Your request to test version({0}) was processed by {1}", vers, CurrentContext.UserName())
            , body
            , IgnoreTT);
    }
Ejemplo n.º 5
0
    protected void ImageButton_Run(object sender, ImageClickEventArgs e)
    {
        string errorMail = "";

        if (!CurrentContext.Admin)
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Access denied')", true);
            return;
        }

        string RequestID = Request.Params["RequestID"];

        if (string.IsNullOrEmpty(RequestID))
        {
            RequestID = "NULL";
        }
        else
        {
            FeedLog("Test request has been changed. Task: " + GetValue("SELECT T.TTID FROM TESTREQUESTS T WHERE ID = " + RequestID));
        }

        string strPRIORITY = PriorityList.SelectedItem.Value;

        string[] Commands;
        string[] arrGroup;

        TestRequest.GetCommandsGroups(FileTextBox.Text, out Commands, out arrGroup);

        TestRequest.SetAdditionalCommands(TextBoxBefore.Text.Replace("'", "''").Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None), TextBoxAfter.Text.Replace("'", "''").Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None), RequestID);

        // get user id

        DataSet DS        = GetDataSet(@"select T2.ID from PERSONS T2 where T2.USER_LOGIN = '******'");
        string  strUserID = DS.Tables[0].Rows[0][0].ToString();

        Schedule.AddCommands(Commands, arrGroup, RequestID, strUserID, strPRIORITY);

        ImageButtonRun.Enabled = false;
        FileTextBox.Enabled    = false;

        //set request priority
        if (RequestID != "NULL")
        {
            SQLExecute(string.Format("update TESTREQUESTS set REQUEST_PRIORITY = {0} where ID = {1}", strPRIORITY, RequestID));
        }
        //set testing person and send email to programmer
        if (RequestID != "NULL")
        {
            TestRequest r = new TestRequest(RequestID);
            Version     v = new Version(r.VERSIONID);

            if (r.USERID == "")
            {
                r.USERID = CurrentContext.UserID.ToString();
                r.Store();

                string body = string.Format(@"
				Your request for version ({0}) test was processed by: {1}
				<br>Your version: ({2} <a href='http://{3}/runs.aspx?R.RequestID={4}'>{0}</a>)
				<br>{5}
				<br>{6}
				<br>
				<br>Your version will be tested as soon as possible.
				<br>Person responsible: <b>{1}</b>
				<br>Best regards, <b>{1}</b>
				"                ,
                                            v.VERSION, CurrentContext.UserName(), r.REQUESTDATETIME, Settings.CurrentSettings.BSTADDRESS, RequestID, r.TTID, r.COMMENT);

                string tasknumber = Regex.Match(r.TTID.ToUpper(), "TT[0-9]+").Value.Replace("TT", "");
                if (!String.IsNullOrEmpty(tasknumber))
                {
                    DefectConnector.NotifyDefectWorker(tasknumber, string.Format("Your request for {0} test was processed by: {1}", tasknumber, CurrentContext.UserName()), CurrentContext.User.PHONE);
                }

                AddEmail(
                    r.PROGABB
                    , string.Format("Your request for version ({0}) test was processed by: {1}", v.VERSION, CurrentContext.UserName())
                    , body
                    , "#FEFCFF");
            }
        }

        LabelError.Visible = false;
        if (errorMail != "")
        {
            LabelError.Text    = errorMail;
            LabelError.Visible = true;
        }
        else if (getBackUrl != null)
        {
            Response.Redirect(Server.UrlDecode(getBackUrl));
        }
    }
Ejemplo n.º 6
0
    protected void CommentButton_Click(object sender, EventArgs e)
    {
        if ((TestOK.Checked == false) && (TestFailed.Checked == false))
        {
            LabelError.Text = "<b> [Please choose result] </b>";
            return;
        }

        string strPutColor = GoodTT;
        string strText     = TestOK.Text;

        if (TestFailed.Checked)
        {
            strPutColor = BadTT; strText = TestFailed.Text;
        }

        LabelError.Text = "";

        String strCommentTest = CMT.Text;

        strCommentTest = strCommentTest.Replace("\r\n", "<br>");

        ArrayList list = GetCaseNameList();

        string[] arrfiles    = GetFilesList(RequestID);
        string   TestRunIDs  = string.Empty;
        string   TestsInMail = string.Empty;

        foreach (CheckBox cb in list)
        {
            if (!String.IsNullOrEmpty(cb.Attributes["TEST_RUN_ID"]))
            {
                if (TestRunIDs == string.Empty)
                {
                    TestRunIDs = cb.Attributes["TEST_RUN_ID"];
                }
                else
                {
                    TestRunIDs += "," + cb.Attributes["TEST_RUN_ID"];
                }

                TestsInMail += string.Format("<a href='http://{0}/", Settings.CurrentSettings.BSTADDRESS) + cb.Attributes["TEST_LINK"] + "'>" + cb.Attributes["CASE_NAME"] + "</a><br>";
            }
        }

        if (TestsInMail != string.Empty)
        {
            TestsInMail = "<br>Tests which were affected by your task:<br>" + TestsInMail + "<br>";
        }

        DB_PutDependentFilesFromTT(TestRunIDs, arrfiles);

        TestRequest tr = new TestRequest(RequestID)
        {
            USERID = CurrentContext.UserID.ToString(), TESTED = strPutColor == GoodTT ? "true" : "false"
        };

        tr.Store();

        //----update TestTrack DB
        string tasknumber = Regex.Match(strTTID.ToUpper(), "TT[0-9]+").Value.Replace("TT", "");

        if (!String.IsNullOrEmpty(tasknumber))
        {
            DefectConnector.UpdateDefect(tasknumber, TestFailed.Checked.ToString(), CurrentContext.User.PHONE);
        }
        //----update end

        string body = string.Format(@"
			Your version: ({0} <a href='http://{1}/runs.aspx?R.RequestID={2}'>{3}</a>)
			<br>{4}
			<br>{5}
			<br>
			<br><b>{6}</b>
			<br>
			<br>Result:
			<br><a href='http://{1}/CompareVersion.aspx?Version1={3}&Version2={7}'>Compare Version</a>
			<br>
			<br>{8}
			<br>{9}
			<br>
			<br>Best regards, <b>{10}</b>"
                                    , strDT, Settings.CurrentSettings.BSTADDRESS, RequestID, strFiPVersion, strTTID, strComment, strText, strFiPVersionBase, strCommentTest, TestsInMail, CurrentContext.UserName());

        /*AddEmail(
         *      strProgrammer
         *      , string.Format("Your request for version ({0}) was tested. Request info: ({1})", strFiPVersion, strTTID)
         *      , body
         *      , strPutColor);*/

        LabelError.Visible = false;
        if (getBackUrl != null)
        {
            Response.Redirect(getBackUrl);
        }
    }