コード例 #1
0
        // [Ignore("Ignore test to prevent exception crashing later tests")]
        public void ShouldFindElementByModel()
        {
            //  NOTE: works with Angular 1.2.13, fails with Angular 1.4.9
            Common.GetLocalHostPageContent("ng_pattern_validate.htm");
            NgWebElement ng_input = ngDriver.FindElement(NgBy.Model("myVal"));

            ng_input.Clear();
            NgWebElement ng_valid = ngDriver.FindElement(NgBy.Binding("form.value.$valid"));

            StringAssert.IsMatch("false", ng_valid.Text);

            NgWebElement ng_pattern = ngDriver.FindElement(NgBy.Binding("form.value.$error.pattern"));

            StringAssert.IsMatch("false", ng_pattern.Text);

            NgWebElement ng_required = ngDriver.FindElement(NgBy.Binding("!!form.value.$error.required"));

            StringAssert.IsMatch("true", ng_required.Text);

            ng_input.SendKeys("42");
            Assert.IsTrue(ng_input.Displayed);
            ng_valid = ngDriver.FindElement(NgBy.Binding("form.value.$valid"));
            StringAssert.IsMatch("true", ng_valid.Text);

            ng_pattern = ngDriver.FindElement(NgBy.Binding("form.value.$error.pattern"));
            StringAssert.IsMatch("false", ng_pattern.Text);

            ng_required = ngDriver.FindElement(NgBy.Binding("!!form.value.$error.required"));
            StringAssert.IsMatch("false", ng_required.Text);
        }
        public void ModifyDirectorName()
        {
            // click on the Edit button for Leader
            NgWebElement uiEditInfoButton = ngDriver.FindElement(By.XPath("//i/span"));

            uiEditInfoButton.Click();

            // enter a new name for the director
            string newDirectorFirstName = "Updated Director";

            NgWebElement uiNewDirectorFirstName = ngDriver.FindElement(By.XPath("//input[@type='text']"));

            uiNewDirectorFirstName.Clear();
            uiNewDirectorFirstName.SendKeys(newDirectorFirstName);

            // click on the Confirm button
            NgWebElement uiConfirmButton = ngDriver.FindElement(By.XPath("//i/span"));

            uiConfirmButton.Click();

            // find the upload test file in the bdd-tests\upload_files folder
            var    environment       = Environment.CurrentDirectory;
            string projectDirectory  = Directory.GetParent(environment).Parent.FullName;
            string projectDirectory2 = Directory.GetParent(projectDirectory).Parent.FullName;

            // upload a marriage certificate document
            string       marriageCertificate = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "marriage_certificate.pdf");
            NgWebElement uploadMarriageCert  = ngDriver.FindElement(By.XPath("(//input[@type='file'])[15]"));

            uploadMarriageCert.SendKeys(marriageCertificate);
        }
コード例 #3
0
        public void HelloNgDriver()
        {
            NgWebElement ngElement = _ngWebDriver.FindElement(NgBy.Model("q"));

            ngElement.Clear();
            ngElement.SendKeys("Hello NgWebDriver");
        }
コード例 #4
0
        public void ShouldNavigateDatesInDatePicker()
        {
            Common.GetLocalHostPageContent("ng_datepicker.htm");
            NgWebElement ng_result = ngDriver.FindElement(NgBy.Model("data.inputOnTimeSet"));

            ng_result.Clear();
            ngDriver.Highlight(ng_result);
            IWebElement calendar = ngDriver.FindElement(By.CssSelector(".input-group-addon"));

            ngDriver.Highlight(calendar);
            Actions actions = new Actions(ngDriver.WrappedDriver);

            actions.MoveToElement(calendar).Click().Build().Perform();

            IWebElement  dropdown    = driver.FindElement(By.CssSelector("div.dropdown.open ul.dropdown-menu"));
            NgWebElement ng_dropdown = new NgWebElement(ngDriver, dropdown);

            Assert.IsNotNull(ng_dropdown);
            NgWebElement ng_display = ngDriver.FindElement(NgBy.Binding("data.previousViewDate.display"));

            Assert.IsNotNull(ng_display);
            String dateDattern = @"\d{4}\-(?<month>\w{3})";

            Regex dateDatternReg = new Regex(dateDattern);

            Assert.IsTrue(dateDatternReg.IsMatch(ng_display.Text));
            ngDriver.Highlight(ng_display);
            String display_month = ng_display.Text.FindMatch(dateDattern);

            // Console.Error.WriteLine("Current month: " + ng_display.Text);
            String[] months =
            {
                "Jan",
                "Feb",
                "Mar",
                "Apr",
                "May",
                "Jun",
                "Jul",
                "Aug",
                "Sep",
                "Oct",
                "Dec",
                "Jan"
            };

            String next_month = months[Array.IndexOf(months, display_month) + 1];

            Console.Error.WriteLine("Current month: " + display_month);
            Console.Error.WriteLine("Next month: " + next_month);
            IWebElement ng_right = ng_display.FindElement(By.XPath("..")).FindElement(By.ClassName("right"));

            Assert.IsNotNull(ng_right);
            ngDriver.Highlight(ng_right, 100);
            ng_right.Click();
            Assert.IsTrue(ng_display.Text.Contains(next_month));
            ngDriver.Highlight(ng_display);
            Console.Error.WriteLine("Next month: " + ng_display.Text);
        }
        public void RequestPersonnelEmailChange(string businessType)
        {
            if (businessType != "indigenous nation")
            {
                /*
                 * Page Title: Welcome to Liquor and Cannabis Licensing
                 */

                // click on the review organization information button
                ClickReviewOrganizationInformation();

                /*
                 * Page Title: [client name] Legal Entity Structure
                 */

                // click on the Edit button for Leader (partnership, sole proprietorship, public corporation, or society)
                if (businessType == "partnership" || businessType == "sole proprietorship" || businessType == "public corporation" || businessType == "society")
                {
                    NgWebElement uiEditInfoButtonPartner = ngDriver.FindElement(By.CssSelector(".fas.fa-pencil-alt span"));
                    uiEditInfoButtonPartner.Click();
                }

                // click on the Edit button for Leader (private corporation)
                if (businessType == "private corporation")
                {
                    NgWebElement uiEditInfoButton = ngDriver.FindElement(By.CssSelector("td:nth-child(7) .ng-star-inserted"));
                    uiEditInfoButton.Click();
                }

                // enter a new email for the associate
                string newEmail = "*****@*****.**";

                NgWebElement uiNewEmail = ngDriver.FindElement(By.CssSelector("input[formcontrolname='emailNew']"));
                uiNewEmail.Clear();
                uiNewEmail.SendKeys(newEmail);

                // click on the Confirm button
                NgWebElement uiConfirmButton = ngDriver.FindElement(By.CssSelector(".fa-save span"));
                uiConfirmButton.Click();

                // click on Confirm Organization Information is Complete button
                NgWebElement uiOrgInfoButton2 = ngDriver.FindElement(By.CssSelector("button.btn-primary"));
                uiOrgInfoButton2.Click();

                /*
                 * Page Title: Welcome to Liquor and Cannabis Licensing
                 */

                // check that dashboard is displayed (i.e. no payment has been required)
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Welcome to Liquor and Cannabis Licensing')]")).Displayed);
            }
        }
        public void ModifyDirectorName()
        {
            // click on the Edit button for Leader
            NgWebElement uiEditInfoButton = ngDriver.FindElement(By.XPath("//i/span"));

            uiEditInfoButton.Click();

            // enter a new name for the director
            string newDirectorFirstName = "Updated Director";

            NgWebElement uiNewDirectorFirstName = ngDriver.FindElement(By.XPath("//input[@type='text']"));

            uiNewDirectorFirstName.Clear();
            uiNewDirectorFirstName.SendKeys(newDirectorFirstName);

            // click on the Confirm button
            NgWebElement uiConfirmButton = ngDriver.FindElement(By.XPath("//i/span"));

            uiConfirmButton.Click();

            // upload a marriage certificate document
            FileUpload("marriage_certificate.pdf", "(//input[@type='file'])[15]");
        }
コード例 #7
0
 public void SetNewElement(NgWebElement element, string newValue)
 {
     element.Clear();
     element.SendKeys(newValue);
     ngDriver.WaitForAngular();
 }
コード例 #8
0
        public void PicnicAreaEndorsement()
        {
            /*
             * Page Title: Licences
             */

            string picnicAreaEndorsement = "Picnic Area Endorsement Application";

            // click on the Picnic Area Endorsement Application link
            NgWebElement uiPicnicAreaEndorsement = ngDriver.FindElement(By.LinkText(picnicAreaEndorsement));

            uiPicnicAreaEndorsement.Click();

            /*
             * Page Title: Please Review the Account Profile
             */

            ContinueToApplicationButton();

            /*
             * Page Title: Manufacturer Picnic Area Endorsement Application
             */

            // create test data
            string proposedChange              = "Description of proposed change(s) such as moving, adding or changing approved picnic area(s)";
            string otherBizDetails             = "Description of other business details";
            string patioCompositionDescription = "Description of patio composition";
            string capacity = "100";

            // enter the description of the proposed change
            NgWebElement uiProposedChange = ngDriver.FindElement(By.CssSelector("textarea#description1"));

            uiProposedChange.SendKeys(proposedChange);

            // enter the other business details
            NgWebElement uiOtherBizDetails = ngDriver.FindElement(By.CssSelector("textarea#otherBusinessesDetails"));

            uiOtherBizDetails.SendKeys(otherBizDetails);

            // enter the patio composition description
            NgWebElement uiPatioCompDesc = ngDriver.FindElement(By.CssSelector("textarea#patioCompDescription"));

            uiPatioCompDesc.SendKeys(patioCompositionDescription);

            // select 'Grass' for patio location
            NgWebElement uiGrass = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-43-button"));

            uiGrass.Click();

            // select 'Earth' for patio location
            NgWebElement uiEarth = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-44-button"));

            uiEarth.Click();

            // select 'Gravel' for patio location
            NgWebElement uiGravel = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-45-button"));

            uiGravel.Click();

            // select 'Finished Flooring' for patio location
            NgWebElement uiFinishedFlooring = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-46-button"));

            uiFinishedFlooring.Click();

            // select 'Cement Sidewalk' for patio location
            NgWebElement uiCementSidewalk = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-47-button"));

            uiCementSidewalk.Click();

            // select 'Other' for patio location
            NgWebElement uiOther = ngDriver.FindElement(By.CssSelector("button#mat-button-toggle-48-button"));

            uiOther.Click();

            // enter the capacity
            NgWebElement uiCapacity = ngDriver.FindElement(By.CssSelector("input[formcontrolname='capacity']"));

            uiCapacity.Clear();
            uiCapacity.SendKeys(capacity);

            // upload the site plan
            FileUpload("site_plan.pdf", "(//input[@type='file'])[2]");

            // upload the exterior photos
            FileUpload("exterior_photos.jpg", "(//input[@type='file'])[5]");

            // click on the authorized to submit checkbox
            NgWebElement uiAuthorizedSubmit = ngDriver.FindElement(By.Id("authorizedToSubmit"));

            uiAuthorizedSubmit.Click();

            // click on the signature agreement checkbox
            NgWebElement uiSignatureAgree = ngDriver.FindElement(By.Id("signatureAgreement"));

            uiSignatureAgree.Click();

            ClickOnSubmitButton();

            //System.Threading.Thread.Sleep(3000);
        }
コード例 #9
0
        public void EventAuthorizationValidation()
        {
            /*
             * Page Title: Catered Event Authorization Request
             */

            // remove event contact name
            NgWebElement uiEventContactName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactName']"));

            uiEventContactName.Clear();

            // remove event contact phone
            NgWebElement uiEventContactPhone = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPhone']"));

            uiEventContactPhone.Clear();

            // remove event description
            NgWebElement uiEventDescription = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='eventTypeDescription']"));

            uiEventDescription.Clear();

            // remove event client or host name
            NgWebElement uiEventClientOrHostName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='clientHostname']"));

            uiEventClientOrHostName.Clear();

            // remove maximum attendance
            NgWebElement uiMaxAttendance = ngDriver.FindElement(By.CssSelector("input[formcontrolname='maxAttendance']"));

            uiMaxAttendance.Clear();

            // remove maximum staff attendance
            NgWebElement uiMaxStaffAttendance = ngDriver.FindElement(By.CssSelector("input[formcontrolname='maxStaffAttendance']"));

            uiMaxStaffAttendance.Clear();

            // remove venue name description
            NgWebElement uiVenueNameDescription = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='venueDescription']"));

            uiVenueNameDescription.Clear();

            // remove venue additional info
            NgWebElement uiVenueAdditionalInfo = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='additionalLocationInformation']"));

            uiVenueAdditionalInfo.Clear();

            // remove physical address - street address 1
            NgWebElement uiPhysicalAddStreetAddress1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='street1']"));

            uiPhysicalAddStreetAddress1.Clear();

            // remove physical address - street address 2
            NgWebElement uiPhysicalAddStreetAddress2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='street2']"));

            uiPhysicalAddStreetAddress2.Clear();

            // remove physical address - city
            NgWebElement uiPhysicalAddCity = ngDriver.FindElement(By.CssSelector("input[formcontrolname='city']"));

            uiPhysicalAddCity.Clear();

            // remove physical address - postal code
            NgWebElement uiPhysicalAddPostalCode = ngDriver.FindElement(By.CssSelector("input[formcontrolname='postalCode']"));

            uiPhysicalAddPostalCode.Clear();

            // deselect terms and conditions checkbox
            NgWebElement uiTermsAndConditions = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='agreement']"));

            uiTermsAndConditions.Click();
        }
コード例 #10
0
        public void ShouldDirectSelectFromDatePicker()
        {
            Common.GetLocalHostPageContent("ng_datepicker.htm");
            // http://dalelotts.github.io/angular-bootstrap-datetimepicker/
            NgWebElement ng_result = ngDriver.FindElement(NgBy.Model("data.inputOnTimeSet"));

            ng_result.Clear();
            ngDriver.Highlight(ng_result);
            IWebElement calendar = ngDriver.FindElement(By.CssSelector(".input-group-addon"));

            ngDriver.Highlight(calendar);
            Actions actions = new Actions(ngDriver.WrappedDriver);

            actions.MoveToElement(calendar).Click().Build().Perform();

            int datepicker_width = 900;
            int datepicker_heght = 800;

            driver.Manage().Window.Size = new System.Drawing.Size(datepicker_width, datepicker_heght);
            IWebElement  dropdown    = driver.FindElement(By.CssSelector("div.dropdown.open ul.dropdown-menu"));
            NgWebElement ng_dropdown = new NgWebElement(ngDriver, dropdown);

            Assert.IsNotNull(ng_dropdown);
            ReadOnlyCollection <NgWebElement> elements = ng_dropdown.FindElements(NgBy.Repeater("dateObject in week.dates"));

            Assert.IsTrue(28 <= elements.Count);

            String      monthDate   = "12";
            IWebElement dateElement = ng_dropdown.FindElements(NgBy.CssContainingText("td.ng-binding", monthDate)).First();

            Console.Error.WriteLine("Mondh Date: " + dateElement.Text);
            dateElement.Click();
            NgWebElement ng_element = ng_dropdown.FindElement(NgBy.Model("data.inputOnTimeSet"));

            Assert.IsNotNull(ng_element);
            ngDriver.Highlight(ng_element);
            ReadOnlyCollection <NgWebElement> ng_dataDates = ng_element.FindElements(NgBy.Repeater("dateObject in data.dates"));

            Assert.AreEqual(24, ng_dataDates.Count);

            String       timeOfDay = "6:00 PM";
            NgWebElement ng_hour   = ng_element.FindElements(NgBy.CssContainingText("span.hour", timeOfDay)).First();

            Assert.IsNotNull(ng_hour);
            ngDriver.Highlight(ng_hour);
            Console.Error.WriteLine("Hour of the day: " + ng_hour.Text);
            ng_hour.Click();
            String specificMinute = "6:35 PM";

            // reload
            // dropdown = driver.FindElement(By.CssSelector("div.dropdown.open ul.dropdown-menu"));
            // ng_dropdown = new NgWebElement(ngDriver, dropdown);
            ng_element = ng_dropdown.FindElement(NgBy.Model("data.inputOnTimeSet"));
            Assert.IsNotNull(ng_element);
            ngDriver.Highlight(ng_element);
            NgWebElement ng_minute = ng_element.FindElements(NgBy.CssContainingText("span.minute", specificMinute)).First();

            Assert.IsNotNull(ng_minute);
            ngDriver.Highlight(ng_minute);
            Console.Error.WriteLine("Time of the day: " + ng_minute.Text);
            ng_minute.Click();
            ng_result = ngDriver.FindElement(NgBy.Model("data.inputOnTimeSet"));
            ngDriver.Highlight(ng_result, 100);
            Console.Error.WriteLine("Selected Date/time: " + ng_result.GetAttribute("value"));
        }
コード例 #11
0
        public void ReviewAccountProfile(string businessType)
        {
            /*
             * Page Title: Please Review the Account Profile
             */

            string bizNumber           = "123456789";
            string incorporationNumber = "BC1234567";

            string physStreetAddress1 = "645 Tyee Road";
            string physStreetAddress2 = "West";
            string physCity           = "Victoria";
            string physPostalCode     = "V9A 6X5";

            string mailStreet1    = "#22";
            string mailStreet2    = "700 Bellevue Way NE";
            string mailCity       = "Bellevue";
            string mailProvince   = "WA";
            string mailPostalCode = "98004";
            string mailCountry    = "United States";

            string bizPhoneNumber   = "2501811818";
            string bizEmail         = "*****@*****.**";
            string corpGiven        = "Automated";
            string corpSurname      = "Testing";
            string corpTitle        = "CEO";
            string corpContactPhone = "7781811818";
            string corpContactEmail = "*****@*****.**";

            // enter the business number
            NgWebElement uiBizNumber = ngDriver.FindElement(By.CssSelector("input[formControlName='businessNumber']"));

            uiBizNumber.SendKeys(bizNumber);

            // enter the private/public corporation or society incorporation number
            if (businessType == " private corporation" || businessType == " society" || businessType == " public corporation")
            {
                // enter incorporation number
                NgWebElement uiCorpNumber = ngDriver.FindElement(By.CssSelector("input[formcontrolname='bcIncorporationNumber']"));
                uiCorpNumber.SendKeys(incorporationNumber);

                // select date of incorporation (= today)
                NgWebElement uiCalendar1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='dateOfIncorporationInBC']"));
                JavaScriptClick(uiCalendar1);

                NgWebElement uiCalendar2 = ngDriver.FindElement(By.CssSelector(".mat-calendar-body-cell-content.mat-calendar-body-today"));
                JavaScriptClick(uiCalendar2);
            }

            // enter the physical street address 1
            NgWebElement uiPhysStreetAddress1 = ngDriver.FindElement(By.CssSelector("input[formControlName='physicalAddressStreet']"));

            uiPhysStreetAddress1.SendKeys(physStreetAddress1);

            // enter the physical street address 2
            NgWebElement uiPhysStreetAddress2 = ngDriver.FindElement(By.CssSelector("input[formControlName='physicalAddressStreet2']"));

            uiPhysStreetAddress2.SendKeys(physStreetAddress2);

            // enter the physical city
            NgWebElement uiPhysCity = ngDriver.FindElement(By.CssSelector("input[formControlName='physicalAddressCity']"));

            uiPhysCity.SendKeys(physCity);

            // select non default province
            NgWebElement uiNonDefaultProvince = ngDriver.FindElement(By.CssSelector("select[formcontrolname='physicalAddressProvince'] option[value='Alberta']"));

            uiNonDefaultProvince.Click();

            // select default province
            NgWebElement uiDefaultProvince = ngDriver.FindElement(By.CssSelector("select[formcontrolname='physicalAddressProvince'] option[value='British Columbia']"));

            uiDefaultProvince.Click();

            // enter the physical postal code
            NgWebElement uiPhysPostalCode = ngDriver.FindElement(By.CssSelector("input[formControlName='physicalAddressPostalCode']"));

            uiPhysPostalCode.SendKeys(physPostalCode);

            // enter the mailing street address 1
            NgWebElement uiMailingStreetAddress1 = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressStreet']"));

            uiMailingStreetAddress1.Clear();
            uiMailingStreetAddress1.SendKeys(mailStreet1);

            // enter the mailing street address 2
            NgWebElement uiMailingStreetAddress2 = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressStreet2']"));

            uiMailingStreetAddress2.Clear();
            uiMailingStreetAddress2.SendKeys(mailStreet2);

            // enter the mailing city
            NgWebElement uiMailingCity = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressCity']"));

            uiMailingCity.Clear();
            uiMailingCity.SendKeys(mailCity);

            // enter the mailing province
            NgWebElement uiMailingProvince = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressProvince']"));

            uiMailingProvince.Clear();
            uiMailingProvince.SendKeys(mailProvince);

            // enter the mailing postal code
            NgWebElement uiMailingPostalCode = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressPostalCode']"));

            uiMailingPostalCode.Clear();
            uiMailingPostalCode.SendKeys(mailPostalCode);

            // enter the mailing country
            NgWebElement uiMailingCountry = ngDriver.FindElement(By.CssSelector("input[formControlName='mailingAddressCountry']"));

            uiMailingCountry.Clear();
            uiMailingCountry.SendKeys(mailCountry);

            // enter the business phone number
            NgWebElement uiBizPhoneNumber = ngDriver.FindElement(By.CssSelector("input[formControlName='contactPhone']"));

            uiBizPhoneNumber.SendKeys(bizPhoneNumber);

            // enter the business email
            NgWebElement uiBizEmail = ngDriver.FindElement(By.CssSelector("input[formControlName='contactEmail']"));

            uiBizEmail.SendKeys(bizEmail);

            if ((businessType == "n indigenous nation") || (businessType == " local government"))
            {
                string liquorPolicyLink = "https://www.liquorpolicy.org";

                // enter the liquor policy information link
                NgWebElement uiLiquorPolicyLink = ngDriver.FindElement(By.CssSelector("input[formcontrolname='websiteUrl']"));
                uiLiquorPolicyLink.SendKeys(liquorPolicyLink);
            }

            // enter the contact given name
            NgWebElement uiFirstName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='firstname']"));

            uiFirstName.SendKeys(corpGiven);

            // enter the contact surname
            NgWebElement uiLastName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lastname']"));

            uiLastName.SendKeys(corpSurname);

            // enter the contact title
            NgWebElement uiCorpTitle = ngDriver.FindElement(By.CssSelector("input[formControlName='jobTitle']"));

            uiCorpTitle.SendKeys(corpTitle);

            // enter the contact phone number
            NgWebElement uiCorpContactPhone = ngDriver.FindElement(By.CssSelector("input[formControlName='telephone1']"));

            uiCorpContactPhone.SendKeys(corpContactPhone);

            // enter the contact email
            NgWebElement uiCorpContactEmail = ngDriver.FindElement(By.CssSelector("input[formcontrolname='emailaddress1']"));

            uiCorpContactEmail.SendKeys(corpContactEmail);

            if ((businessType == "n indigenous nation") || (businessType == " local government"))
            {
                // select 'Yes' for connection to a federal producer
                NgWebElement uiINConnectionFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='iNConnectionToFederalProducer']"));
                uiINConnectionFederalProducer.Click();

                // enter the name of the federal producer and details of the connection
                string       INnameAndDetails           = "Name and details of federal producer (automated test) for IN/local government.";
                NgWebElement uiINDetailsFederalProducer = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='iNConnectionToFederalProducerDetails']"));
                uiINDetailsFederalProducer.SendKeys(INnameAndDetails);
            }

            if ((businessType == " private corporation") || (businessType == " sole proprietorship") || (businessType == " university"))
            {
                // select 'Yes' for corporation connection to federal producer
                NgWebElement uiCorpConnectionFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='corpConnectionFederalProducer']"));
                uiCorpConnectionFederalProducer.Click();

                // enter the name of the federal producer and details of the connection
                string       nameAndDetails            = "The name of the federal producer and details of the connection.";
                NgWebElement uiDetailsFederalProducer2 = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='corpConnectionFederalProducerDetails']"));
                uiDetailsFederalProducer2.SendKeys(nameAndDetails);

                // select 'Yes' for federal producer connection to corporation
                NgWebElement uiCorpConnectionFederalProducer2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='federalProducerConnectionToCorp']"));
                uiCorpConnectionFederalProducer2.Click();

                // enter the name of the federal producer and details of the connection
                string       nameAndDetails2           = "Name and details of federal producer connection to corporation.";
                NgWebElement uiDetailsFederalProducer3 = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='federalProducerConnectionToCorpDetails']"));
                uiDetailsFederalProducer3.SendKeys(nameAndDetails2);
            }

            if ((businessType == " partnership"))
            {
                // select 'Yes' for partnership connection to federal producer
                NgWebElement uiPartnerConnectionFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='partnersConnectionFederalProducer']"));
                uiPartnerConnectionFederalProducer.Click();

                // enter the name of the federal producer and details of the connection
                string       nameAndDetails            = "The name of the federal producer and details of the connection (partnership).";
                NgWebElement uiDetailsFederalProducer2 = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='partnersConnectionFederalProducerDetails']"));
                uiDetailsFederalProducer2.SendKeys(nameAndDetails);

                // select 'Yes' for federal producer connection to corporation
                NgWebElement uiCorpConnectionFederalProducer2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='federalProducerConnectionToCorp']"));
                uiCorpConnectionFederalProducer2.Click();

                // enter the name of the federal producer and details of the connection
                string       nameAndDetails2           = "Name and details of federal producer connection to corporation.";
                NgWebElement uiDetailsFederalProducer3 = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='federalProducerConnectionToCorpDetails']"));
                uiDetailsFederalProducer3.SendKeys(nameAndDetails2);
            }

            if (businessType == " public corporation")
            {
                // select 'Yes' for corporation connection to federal producer
                NgWebElement uiCorpConnectionFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='corpConnectionFederalProducer']"));
                uiCorpConnectionFederalProducer.Click();

                // enter the name of the federal producer and details of the connection
                string       nameAndDetails            = "The name of the federal producer and details of the connection.";
                NgWebElement uiDetailsFederalProducer2 = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='corpConnectionFederalProducerDetails']"));
                uiDetailsFederalProducer2.SendKeys(nameAndDetails);

                // select 'Yes' for shareholder connection
                NgWebElement uiShareholderConnectionConnectionToCorp = ngDriver.FindElement(By.CssSelector("input[formcontrolname='share20PlusConnectionProducer']"));
                uiShareholderConnectionConnectionToCorp.Click();

                string       shareholderDetails   = "Details of shareholder relationship.";
                NgWebElement uiShareholderDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='share20PlusConnectionProducerDetails']"));
                uiShareholderDetails.SendKeys(shareholderDetails);

                // select 'Yes' for family connection
                NgWebElement uiFamilyConnectionConnectionToCorp = ngDriver.FindElement(By.CssSelector("input[formcontrolname='share20PlusFamilyConnectionProducer']"));
                uiFamilyConnectionConnectionToCorp.Click();

                // enter details of family connection
                string       familyRelationship        = "Details of family relationship (automated test).";
                NgWebElement uiFamilyConnectionDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='share20PlusFamilyConnectionProducerDetail']"));
                uiFamilyConnectionDetails.SendKeys(familyRelationship);
            }

            if (businessType == " society")
            {
                // select 'Yes' for society connection to federal producer
                NgWebElement uiSocietyConnectionFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='societyConnectionFederalProducer']"));
                uiSocietyConnectionFederalProducer.Click();

                // enter details of society connection
                string       societyDetails             = "Details of society/federal producer relationship.";
                NgWebElement uiSocietyConnectionDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='societyConnectionFederalProducerDetails']"));
                uiSocietyConnectionDetails.SendKeys(societyDetails);
            }

            // click on the liquor financial interest radio button
            NgWebElement uiLiquorFinInterestRadio = ngDriver.FindElement(By.XPath("//app-connection-to-producers/div[3]/section[1]/input[1]"));

            uiLiquorFinInterestRadio.Click();

            // enter the details of the financial interest
            string       finDetails = "Details of the financial interest (automated test).";
            NgWebElement uiLiquorFinInterestTextArea = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname = 'liquorFinancialInterestDetails']"));

            uiLiquorFinInterestTextArea.SendKeys(finDetails);

            // click on Continue to Organization Review button
            NgWebElement uiContinueAppButton = ngDriver.FindElement(By.Id("continueToApp"));

            uiContinueAppButton.Click();
        }
コード例 #12
0
        public void CompleteApplication(string licenceType)
        {
            /*
             * Page Title: Covid Temporary Extension Application
             */

            // create test data
            string licencenumber = "123456";
            string licenceename  = "Point Ellis Operations";
            string estname       = "Point Ellis Greenhouse";
            string eststreet     = "645 Tyee Road";
            string estcity       = "Victoria";
            string estpostal     = "V8V4Y3";
            string contactfirst  = "ContactFirst";
            string contactlast   = "ContactLast";
            string contacttitle  = "Director";
            string contacttel    = "2501811181";
            string contactemail  = "*****@*****.**";
            string mailingstreet = "MailingStreet";
            string mailingcity   = "MailingCity";
            string mailingpostal = "V8V4Y3";

            // enter the licence number
            NgWebElement uiLicenceNumber = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'description1']"));

            uiLicenceNumber.SendKeys(licencenumber);

            if (licenceType == "Food Primary licence")
            {
                // select the food primary licence type
                NgWebElement uiLicenceType = ngDriver.FindElement(By.CssSelector("[formcontrolname='licenceType'] .mat-radio-button[value='Food Primary']"));
                uiLicenceType.Click();
            }

            if (licenceType == "Liquor Primary licence")
            {
                // select the licence type for Liquor Primary
                NgWebElement uiLicenceType1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='licenceType'] .mat-radio-button[value='Liquor Primary']"));
                uiLicenceType1.Click();
            }

            if (licenceType == "Liquor Primary Club licence")
            {
                // select the licence type for Liquor Primary Club
                NgWebElement uiLicenceType2 = ngDriver.FindElement(By.CssSelector("[formcontrolname='licenceType'] .mat-radio-button[value='Liquor Primary Club']"));
                uiLicenceType2.Click();
            }

            if (licenceType == "Manufacturer licence")
            {
                // select the licence type for Winery
                NgWebElement uiLicenceType3 = ngDriver.FindElement(By.CssSelector("[formcontrolname='licenceType'] .mat-radio-button[value='Manufacturer']"));
                uiLicenceType3.Click();
            }

            // enter the establishment name
            NgWebElement uiEstName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentName']"));

            uiEstName.SendKeys(estname);

            // enter the establishment street
            NgWebElement uiEstStreet = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentAddressStreet']"));

            uiEstStreet.SendKeys(eststreet);

            // enter the establishment city
            NgWebElement uiEstCity = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentAddressCity']"));

            uiEstCity.SendKeys(estcity);

            // enter the establishment postal code
            NgWebElement uiEstPostal = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentAddressPostalCode']"));

            uiEstPostal.SendKeys(estpostal);

            // select 'Yes' for ALR location
            NgWebElement uiIsALR = ngDriver.FindElement(By.CssSelector("[formcontrolname='proposedEstablishmentIsAlr'] mat-radio-button[value='true']"));

            uiIsALR.Click();

            // enter the licencee name
            NgWebElement uiLicenceeName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='nameOfApplicant']"));

            uiLicenceeName.SendKeys(licenceename);

            // enter the contact first name
            NgWebElement uiContactFirst = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonFirstName']"));

            uiContactFirst.SendKeys(contactfirst);

            // enter the contact last name
            NgWebElement uiContactLast = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonLastName']"));

            uiContactLast.SendKeys(contactlast);

            // enter the contact title
            NgWebElement uiContactTitle = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonRole']"));

            uiContactTitle.SendKeys(contacttitle);

            // enter the contact phone number
            NgWebElement uiContactTel = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonPhone']"));

            uiContactTel.SendKeys(contacttel);

            // enter the contact email
            NgWebElement uiContactEmail = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonEmail']"));

            uiContactEmail.SendKeys(contactemail);

            // enter the mailing street
            NgWebElement uiMailingStreet = ngDriver.FindElement(By.CssSelector("input[formcontrolname='addressStreet']"));

            uiMailingStreet.Clear();
            uiMailingStreet.SendKeys(mailingstreet);

            // enter the mailing city
            NgWebElement uiMailingCity = ngDriver.FindElement(By.CssSelector("input[formcontrolname='addressCity']"));

            uiMailingCity.Clear();
            uiMailingCity.SendKeys(mailingcity);

            // enter the mailing postal code
            NgWebElement uiMailingPostal = ngDriver.FindElement(By.CssSelector("input[formcontrolname='addressPostalCode']"));

            uiMailingPostal.Clear();
            uiMailingPostal.SendKeys(mailingpostal);

            // select the bounded status checkbox
            NgWebElement boundedStatus = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='boundedStatus']"));

            boundedStatus.Click();

            // upload a floor plan document
            FileUpload("floor_plan.pdf", "(//input[@type='file'])[2]");

            if (licenceType != "Food Primary licence")
            {
                // select LG/IN wishes to review radio button
                NgWebElement LGINReview = ngDriver.FindElement(By.CssSelector("[formcontrolname='lgStatus'] mat-radio-button[value='option2']"));
                LGINReview.Click();

                // upload LG/IN approval document
                FileUpload("LG_IN_approval.pdf", "(//input[@type='file'])[8]");
            }

            // upload a representative notification form
            FileUpload("licensee_rep_notification.pdf", "(//input[@type='file'])[5]");

            // click on the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.XPath("(//input[@type='checkbox'])[3]"));

            uiSignatureAgreement.Click();
        }
コード例 #13
0
        public void RequestNameBrandingChange(string changeType)
        {
            /*
             * Page Title: Licences & Authorizations
             */

            string nameBrandingLinkCannabis           = "Request Store Name or Branding Change";
            string nameBrandingLinkCateringMfgUBrewFP = "Establishment Name Change Application";

            if ((changeType == "Catering") || (changeType == "Manufacturing") || (changeType == "UBrew") || (changeType == "Food Primary") || (changeType == "Rural RLS"))
            {
                // click on the Establishment Name Change Application link
                NgWebElement uiRequestChange = ngDriver.FindElement(By.LinkText(nameBrandingLinkCateringMfgUBrewFP));
                uiRequestChange.Click();
            }

            if (changeType == "Cannabis")
            {
                // click on the Request Store Name or Branding Change link
                NgWebElement uiRequestChange = ngDriver.FindElement(By.LinkText(nameBrandingLinkCannabis));
                uiRequestChange.Click();
            }

            /*
             * Page Title: Please Review the Account Profile
             */

            ContinueToApplicationButton();

            /*
             * Page Title: Submit a Name or Branding Change Application
             */

            string newEstablishmentName = "Point Ellis Conservatory";

            // enter a new establishment name
            NgWebElement uiEstablishmentName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentName']"));

            uiEstablishmentName.Clear();
            uiEstablishmentName.SendKeys(newEstablishmentName);

            // click on the authorized to submit checkbox
            NgWebElement uiAuthSubmit = ngDriver.FindElement(By.Id("authorizedToSubmit"));

            uiAuthSubmit.Click();

            // click on the signature agreement checkbox
            NgWebElement uiSigAgreement = ngDriver.FindElement(By.Id("signatureAgreement"));

            uiSigAgreement.Click();

            // upload a supporting document
            FileUpload("signage.pdf", "(//input[@type='file'])[2]");


            if (changeType == "Cannabis")
            {
                // click on the store exterior change button
                NgWebElement uiStoreExterior = ngDriver.FindElement(By.Id("mat-button-toggle-2-button"));
                uiStoreExterior.Click();
            }

            // retrieve the application ID
            // string[] parsedURL = URL.Split('/');

            // string[] tempFix = parsedURL[5].Split(';');

            // applicationID = tempFix[0];

            // click on the Submit & Pay button
            ClickOnSubmitButton();

            // pay for the branding change application
            MakePayment();
        }
        public void RequestPersonnelNameChange(string businessType)
        {
            if (businessType != "indigenous nation")
            {
                /*
                 * Page Title: Welcome to Liquor and Cannabis Licensing
                 */

                // click on the review organization information button
                ClickReviewOrganizationInformation();

                /*
                 * Page Title: [client name] Legal Entity Structure
                 */

                // click on the Edit button for Leader (partnership, sole proprietorship, private corporation, or society)
                if (businessType == "partnership" || businessType == "sole proprietorship" || businessType == "private corporation" || businessType == "society")
                {
                    NgWebElement uiEditInfoButtonShared = ngDriver.FindElement(By.CssSelector(".fas.fa-pencil-alt span"));
                    uiEditInfoButtonShared.Click();
                }

                // click on the Edit button for Leader (public corporation)
                if (businessType == "public corporation")
                {
                    NgWebElement uiEditInfoButton = ngDriver.FindElement(By.CssSelector("td:nth-child(7) .ng-star-inserted"));
                    uiEditInfoButton.Click();
                }

                // enter a new name for the director
                string newDirectorFirstName = "UpdatedFirstName";
                string newDirectorLastName  = "UpdatedLastName";

                NgWebElement uiNewDirectorFirstName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='firstNameNew']"));
                uiNewDirectorFirstName.Clear();
                uiNewDirectorFirstName.SendKeys(newDirectorFirstName);

                NgWebElement uiNewDirectorLasttName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lastNameNew']"));
                uiNewDirectorLasttName.Clear();
                uiNewDirectorLasttName.SendKeys(newDirectorLastName);

                // click on the Confirm button
                NgWebElement uiConfirmButton = ngDriver.FindElement(By.CssSelector(".fa-save span"));
                uiConfirmButton.Click();

                // upload a marriage certificate document
                if (businessType == "public corporation" || businessType == "partnership")
                {
                    FileUpload("marriage_certificate.pdf", "(//input[@type='file'])[9]");
                }

                if (businessType == "private corporation")
                {
                    FileUpload("marriage_certificate.pdf", "(//input[@type='file'])[15]");
                }

                if ((businessType == "society") || (businessType == "sole proprietorship"))
                {
                    FileUpload("marriage_certificate.pdf", "(//input[@type='file'])[6]");
                }

                // click on Submit Organization Information button
                NgWebElement uiSubmitOrgStructure = ngDriver.FindElement(By.CssSelector("button.btn-primary[name='submit-application']"));
                uiSubmitOrgStructure.Click();

                MakePayment();
            }
        }
コード例 #15
0
        public void RequestPersonnelNameChange(string businessType)
        {
            if (businessType != "indigenous nation")
            {
                /*
                 * Page Title: Welcome to Liquor and Cannabis Licensing
                 */

                // click on the review organization information button
                ClickReviewOrganizationInformation();

                /*
                 * Page Title: [client name] Legal Entity Structure
                 */

                // click on the Edit button for Leader (partnership, sole proprietorship, private corporation, or society)
                if (businessType == "partnership" || businessType == "sole proprietorship" || businessType == "private corporation" || businessType == "society")
                {
                    NgWebElement uiEditInfoButtonShared = ngDriver.FindElement(By.CssSelector(".fas.fa-pencil-alt span"));
                    uiEditInfoButtonShared.Click();
                }

                // click on the Edit button for Leader (public corporation)
                if (businessType == "public corporation")
                {
                    NgWebElement uiEditInfoButton = ngDriver.FindElement(By.CssSelector("td:nth-child(7) .ng-star-inserted"));
                    uiEditInfoButton.Click();
                }

                // enter a new name for the director
                string newDirectorFirstName = "UpdatedFirstName";
                string newDirectorLastName  = "UpdatedLastName";

                NgWebElement uiNewDirectorFirstName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='firstNameNew']"));
                uiNewDirectorFirstName.Clear();
                uiNewDirectorFirstName.SendKeys(newDirectorFirstName);

                NgWebElement uiNewDirectorLasttName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lastNameNew']"));
                uiNewDirectorLasttName.Clear();
                uiNewDirectorLasttName.SendKeys(newDirectorLastName);

                // click on the Confirm button
                NgWebElement uiConfirmButton = ngDriver.FindElement(By.CssSelector(".fa-save span"));
                uiConfirmButton.Click();

                // find the upload test file in the bdd-tests\upload_files folder
                var    environment       = Environment.CurrentDirectory;
                string projectDirectory  = Directory.GetParent(environment).Parent.FullName;
                string projectDirectory2 = Directory.GetParent(projectDirectory).Parent.FullName;

                // upload a marriage certificate document
                string marriageCertificate = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "marriage_certificate.pdf");

                if (businessType == "public corporation" || businessType == "partnership")
                {
                    NgWebElement uiUploadMarriageCert = ngDriver.FindElement(By.XPath("(//input[@type='file'])[9]"));
                    uiUploadMarriageCert.SendKeys(marriageCertificate);
                }

                if (businessType == "private corporation")
                {
                    NgWebElement uiUploadMarriageCert = ngDriver.FindElement(By.XPath("(//input[@type='file'])[15]"));
                    uiUploadMarriageCert.SendKeys(marriageCertificate);
                }

                if (businessType == "society")
                {
                    NgWebElement uiUploadMarriageCert = ngDriver.FindElement(By.XPath("(//input[@type='file'])[6]"));
                    uiUploadMarriageCert.SendKeys(marriageCertificate);
                }

                if (businessType == "sole proprietorship")
                {
                    NgWebElement uiUploadMarriageCert = ngDriver.FindElement(By.XPath("(//input[@type='file'])[6]"));
                    uiUploadMarriageCert.SendKeys(marriageCertificate);
                }

                // click on Submit Organization Information button
                NgWebElement uiSubmitOrgStructure = ngDriver.FindElement(By.CssSelector("button.btn-primary[name='submit-application']"));
                uiSubmitOrgStructure.Click();

                MakePayment();
            }
        }