public void AllAgesLiquorFreeEvent()
        {
            /*
             * Page Title: All Ages Liquor Free Event
             */

            // create test data
            string eventName          = "Test Event";
            string eventNote          = "Sample test event note.";
            string contactName        = "Contact Name";
            string contactPhoneNumber = "(222) 222-2222";
            string contactEmail       = "*****@*****.**";

            // enter the event name
            NgWebElement uiEventName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='eventName']"));

            uiEventName.SendKeys(eventName);

            // enter the event note
            NgWebElement uiEventNote = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='eventTypeDescription']"));

            uiEventNote.SendKeys(eventNote);

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

            uiContactName.SendKeys(contactName);

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

            uiContactPhone.SendKeys(contactPhoneNumber);

            // select end date
            NgWebElement uiEndDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='endDate']"));

            uiEndDate1.Click();

            SharedCalendarDate();

            // select start date
            NgWebElement uiStartDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='startDate']"));

            JavaScriptClick(uiStartDate1);

            SharedCalendarDate();

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

            uiContactEmail.SendKeys(contactEmail);

            // confirm the contact email
            NgWebElement uiContactEmailConfirmation = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactEmailConfirmation']"));

            uiContactEmailConfirmation.SendKeys(contactEmail);

            // decrement event start hour
            NgWebElement uiEventStartHour = ngDriver.FindElement(By.CssSelector("[formcontrolname='startTime'] .ngb-tp-hour [type='button'] span.bottom"));

            JavaScriptClick(uiEventStartHour);

            // decrement event start minute
            NgWebElement uiEventStartMinute = ngDriver.FindElement(By.CssSelector("[formcontrolname='startTime'] .ngb-tp-minute span.ngb-tp-chevron.bottom"));

            JavaScriptClick(uiEventStartMinute);

            // decrement event end hour
            NgWebElement uiEventEndHour = ngDriver.FindElement(By.CssSelector("[formcontrolname='endTime'] .ngb-tp-hour [type='button'] span.bottom"));

            JavaScriptClick(uiEventEndHour);

            // decrement event end minute
            NgWebElement uiEventEndMinute = ngDriver.FindElement(By.CssSelector("[formcontrolname='endTime'] .ngb-tp-minute [type='button'] span.bottom"));

            JavaScriptClick(uiEventEndMinute);

            // select agreement checkbox
            NgWebElement uiAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox.mat-checkbox[formcontrolname='isAgreement1']"));

            JavaScriptClick(uiAgreement);

            // select review checkbox
            NgWebElement uiReview = ngDriver.FindElement(By.CssSelector("mat-checkbox.mat-checkbox[formcontrolname='isAgreement2']"));

            JavaScriptClick(uiReview);
        }
        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);
        }
        public void LoungeAreaEndorsement()
        {
            /*
             * Page Title: Licences
             */

            string loungeAreaEndorsement = "Lounge Area Endorsement Application";

            // click on the Lounge Area Endorsement Application link
            NgWebElement uiLoungeAreaEndorsement = ngDriver.FindElement(By.LinkText(loungeAreaEndorsement));

            uiLoungeAreaEndorsement.Click();

            // click on the Continue to Application button
            NgWebElement uiContinueToApplicationButton = ngDriver.FindElement(By.CssSelector("button#continueToApp.save-cont.btn-primary"));

            uiContinueToApplicationButton.Click();

            /*
             * Page Title: Lounge Area Endorsement Application
             */

            // select the zoning checkbox
            NgWebElement uiZoningCheckbox = ngDriver.FindElement(By.CssSelector("mat-checkbox#mat-checkbox-1"));

            uiZoningCheckbox.Click();

            // find the upload test files 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 the floor plan
            string       floorplanPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "floor_plan.pdf");
            NgWebElement uiUploadFloorplan = ngDriver.FindElement(By.XPath("(//input[@type='file'])[2]"));

            uiUploadFloorplan.SendKeys(floorplanPath);

            // upload the site plan
            string       sitePlanPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "site_plan.pdf");
            NgWebElement uiUploadSitePlan = ngDriver.FindElement(By.XPath("(//input[@type='file'])[5]"));

            uiUploadSitePlan.SendKeys(sitePlanPath);

            // add a service area
            NgWebElement uiServiceArea = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceAreas'] button"));

            uiServiceArea.Click();

            // create test data
            string areaDescription = "Area description";
            string occupantLoad    = "100";

            // enter the area description
            NgWebElement uiAreaDescription = ngDriver.FindElement(By.CssSelector("input[formcontrolname='areaLocation']"));

            uiAreaDescription.SendKeys(areaDescription);

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

            uiOccupantLoad.SendKeys(occupantLoad);

            // select the Sunday opening time
            NgWebElement uiSundayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSundayOpen'] option[value='10:00']"));

            uiSundayOpen.Click();

            // select the Sunday closing time
            NgWebElement uiSundayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSundayClose'] option[value='16:00']"));

            uiSundayClose.Click();

            // select the Monday opening time
            NgWebElement uiMondayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursMondayOpen'] option[value='09:00']"));

            uiMondayOpen.Click();

            // select the Monday closing time
            NgWebElement uiMondayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursMondayClose'] option[value='23:00']"));

            uiMondayClose.Click();

            // select the Tuesday opening time
            NgWebElement uiTuesdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursTuesdayOpen'] option[value='09:15']"));

            uiTuesdayOpen.Click();

            // select the Tuesday closing time
            NgWebElement uiTuesdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursTuesdayClose'] option[value='22:45']"));

            uiTuesdayClose.Click();

            // select the Wednesday opening time
            NgWebElement uiWednesdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursWednesdayOpen'] option[value='09:30']"));

            uiWednesdayOpen.Click();

            // select the Wednesday closing time
            NgWebElement uiWednesdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursWednesdayClose'] option[value='12:00']"));

            uiWednesdayClose.Click();

            // select the Thursday opening time
            NgWebElement uiThursdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursThursdayOpen'] option[value='13:00']"));

            uiThursdayOpen.Click();

            // select the Thursday closing time
            NgWebElement uiThursdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursThursdayClose'] option[value='14:00']"));

            uiThursdayClose.Click();

            // select the Friday opening time
            NgWebElement uiFridayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursFridayOpen'] option[value='12:15']"));

            uiFridayOpen.Click();

            // select the Friday closing time
            NgWebElement uiFridayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursFridayClose'] option[value='21:15']"));

            uiFridayClose.Click();

            // select the Saturday opening time
            NgWebElement uiSaturdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSaturdayOpen'] option[value='10:00']"));

            uiSaturdayOpen.Click();

            // select the Saturday closing time
            NgWebElement uiSaturdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSaturdayClose'] option[value='22:00']"));

            uiSaturdayClose.Click();

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("input[formcontrolname='authorizedToSubmit'][type='checkbox']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("input[formcontrolname='signatureAgreement'][type='checkbox']"));

            uiSignatureAgreement.Click();

            ClickOnSubmitButton();

            Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,' Pending External Review ')]")).Displayed);
        }
        public void StructuralAlterations()
        {
            /*
             * Page Title: Licences
             */

            string structuralAlterations = "Structural Alterations to an Approved Lounge or Special Events Area";

            // click on the Structural Alterations Application link
            NgWebElement uiStructuralAlterations = ngDriver.FindElement(By.LinkText(structuralAlterations));

            uiStructuralAlterations.Click();

            ContinueToApplicationButton();

            // create test data
            string outdoorAreaDescription = "Sample outdoor area description";
            string outdoorAreaCapacity    = "10";
            string capacityAreaOccupants  = "20";

            // find the upload test files 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 the floor plan
            string       floorplanPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "floor_plan.pdf");
            NgWebElement uiUploadFloorplan = ngDriver.FindElement(By.XPath("(//input[@type='file'])[2]"));

            uiUploadFloorplan.SendKeys(floorplanPath);

            // add outside area
            NgWebElement uiOutdoorArea = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] button"));

            uiOutdoorArea.Click();

            // enter the outdooor area description
            NgWebElement uiOutdoorAreaDescription = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] input[formcontrolname='areaLocation']"));

            uiOutdoorAreaDescription.SendKeys(outdoorAreaDescription);

            // enter the outdoor area occupant load
            NgWebElement uiOutdoorAreaOccupantLoad = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] input[formcontrolname='capacity']"));

            uiOutdoorAreaOccupantLoad.SendKeys(outdoorAreaCapacity);

            // enter capacity area occupant load
            NgWebElement uiCapacityAreaOccupantLoad = ngDriver.FindElement(By.CssSelector("[formgroupname='capacityArea'] input[formcontrolname='capacity']"));

            uiCapacityAreaOccupantLoad.SendKeys(capacityAreaOccupants);

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("input[formcontrolname='authorizedToSubmit'][type='checkbox']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("input[formcontrolname='signatureAgreement'][type='checkbox']"));

            uiSignatureAgreement.Click();

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

            MakePayment();
        }
        public void ShouldDeposit()
        {
            ngDriver.FindElement(NgBy.ButtonText("Customer Login")).Click();
            ReadOnlyCollection <NgWebElement> ng_customers = ngDriver.FindElement(NgBy.Model("custId")).FindElements(NgBy.Repeater("cust in Customers"));

            // select customer to log in
            ng_customers.First(cust => Regex.IsMatch(cust.Text, "Harry Potter")).Click();

            ngDriver.FindElement(NgBy.ButtonText("Login")).Click();
            ngDriver.FindElement(NgBy.Options("account for account in Accounts")).Click();

            // inspect the account
            NgWebElement ng_account_number = ngDriver.FindElement(NgBy.Binding("accountNo"));
            int          account_id        = 0;

            int.TryParse(ng_account_number.Text.FindMatch(@"(?<account_number>\d+)$"), out account_id);
            Assert.AreNotEqual(0, account_id);

            int account_balance = -1;

            int.TryParse(ngDriver.FindElement(NgBy.Binding("amount")).Text.FindMatch(@"(?<account_balance>\d+)$"), out account_balance);
            Assert.AreNotEqual(-1, account_balance);
            NgWebElement ng_deposit_button = ngDriver.FindElement(NgBy.PartialButtonText("Deposit"));

            Assert.IsTrue(ng_deposit_button.Displayed);

            actions.MoveToElement(ng_deposit_button.WrappedElement).Build().Perform();
            Thread.Sleep(500);
            ng_deposit_button.Click();

            // core Selenium
            wait.Until(ExpectedConditions.ElementExists(By.CssSelector("form[name='myForm']")));
            NgWebElement ng_form_element = new NgWebElement(ngDriver, driver.FindElement(By.CssSelector("form[name='myForm']")));

            // deposit amount
            NgWebElement ng_deposit_amount = ng_form_element.FindElement(NgBy.Model("amount"));

            ng_deposit_amount.SendKeys("100");

            // wait.Until(ExpectedConditions.ElementIsVisible(NgBy.ButtonText("Deposit")));

            // Confirm to perform deposit
            ReadOnlyCollection <NgWebElement> ng_deposit_buttons = ng_form_element.FindElements(NgBy.ButtonText("Deposit"));
            NgWebElement ng_submit_deposit_button = ng_form_element.FindElements(NgBy.ButtonText("Deposit")).First(o => o.GetAttribute("class").IndexOf("btn-default", StringComparison.InvariantCultureIgnoreCase) > -1);
            String       x = ng_submit_deposit_button.GetAttribute("class");

            actions.MoveToElement(ng_submit_deposit_button.WrappedElement).Build().Perform();
            ngDriver.Highlight(ng_submit_deposit_button, highlight_timeout);

            ng_submit_deposit_button.Click();
            // http://www.way2automation.com/angularjs-protractor/banking/depositTx.html

            // inspect message
            var ng_message = ngDriver.FindElement(NgBy.Binding("message"));

            StringAssert.Contains("Deposit Successful", ng_message.Text);
            ngDriver.Highlight(ng_message, highlight_timeout);

            // re-read the amount
            int updated_account_balance = -1;

            int.TryParse(ngDriver.FindElement(NgBy.Binding("amount")).Text.FindMatch(@"(?<account_balance>\d+)$"), out updated_account_balance);
            Assert.AreEqual(updated_account_balance, account_balance + 100);
        }
        public void CompleteCateringApplication(string bizType)
        {
            /*
             * Page Title: Catering Licence Application
             */

            // create application info
            string estName              = "Point Ellis Greenhouse";
            string estAddress           = "645 Tyee Rd";
            string estCity              = "Victoria";
            string estPostal            = "V9A 6X5";
            string estPID               = "012345678";
            string estPhone             = "2505555555";
            string estEmail             = "*****@*****.**";
            string conGiven             = "Given";
            string conSurname           = "Surname";
            string conRole              = "CEO";
            string conPhone             = "2508888888";
            string conEmail             = "*****@*****.**";
            string prevAppDetails       = "Here are the previous application details (automated test).";
            string liqConnectionDetails = "Here are the liquor industry connection details (automated test).";
            string kitchenDetails       = "Here are the details of the kitchen equipment.";
            string transportDetails     = "Here are the transport details.";

            if (bizType == "partnership")
            {
                // upload a partnership agreement
                FileUpload("partnership_agreement.pdf", "(//input[@type='file'])[3]");

                // upload personal history summary
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[6]");
            }

            if (bizType == "public corporation")
            {
                // upload a central securities register
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[3]");

                // upload supporting biz documents
                FileUpload("business_plan.pdf", "(//input[@type='file'])[6]");

                // upload notice of articles
                FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[9]");

                // upload personal history summary documents
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[12]");

                // upload shareholders < 10% interest
                FileUpload("shareholders_less_10_interest.pdf", "(//input[@type='file'])[15]");
            }

            if (bizType == "private corporation")
            {
                // upload a central securities register
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[3]");

                // upload supporting business documentation
                FileUpload("associates.pdf", "(//input[@type='file'])[6]");

                // upload notice of articles
                FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[9]");

                // upload personal history summary documents
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[12]");

                // upload shareholders < 10% interest
                FileUpload("shareholders_less_10_interest.pdf", "(//input[@type='file'])[15]");
            }

            if (bizType == "society")
            {
                // upload notice of articles
                FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[3]");

                // upload personal history summary documents
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[6]");
            }

            if (bizType == "sole proprietorship")
            {
                // upload personal history summary documents
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[3]");
            }

            // enter the establishment name
            NgWebElement uiEstabName = null;

            for (int i = 0; i < 10; i++)
            {
                try
                {
                    var names = ngDriver.FindElements(By.CssSelector("input[formcontrolname='establishmentName']"));
                    if (names.Count > 0)
                    {
                        uiEstabName = names[0];
                        break;
                    }
                }
                catch (Exception)
                {
                }
            }
            uiEstabName.SendKeys(estName);

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

            uiEstabAddress.SendKeys(estAddress);

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

            uiEstabCity.SendKeys(estCity);

            // enter the establishment postal code
            NgWebElement uiEstabPostal = ngDriver.FindElement(By.Id("establishmentAddressPostalCode"));

            uiEstabPostal.SendKeys(estPostal);

            // enter the PID
            NgWebElement uiEstabPID = ngDriver.FindElement(By.Id("establishmentParcelId"));

            uiEstabPID.SendKeys(estPID);

            // enter the store email
            NgWebElement uiEstabEmail = ngDriver.FindElement(By.Id("establishmentEmail"));

            uiEstabEmail.SendKeys(estEmail);

            // enter the store phone number
            NgWebElement uiEstabPhone = ngDriver.FindElement(By.Id("establishmentPhone"));

            uiEstabPhone.SendKeys(estPhone);

            // select 'Yes'
            // Do you or any of your shareholders currently hold, have held, or have previously applied for a British Columbia liquor licence?
            if ((bizType == "private corporation") || (bizType == "partnership") || (bizType == "society") || (bizType == "public corporation") || (bizType == "sole proprietorship"))
            {
                NgWebElement uiPreviousLicenceYes = null;
                for (int i = 0; i < 10; i++)
                {
                    try
                    {
                        var names = ngDriver.FindElements(By.Id("mat-button-toggle-73-button"));
                        if (names.Count > 0)
                        {
                            uiPreviousLicenceYes = names[0];
                            break;
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
                JavaScriptClick(uiPreviousLicenceYes);
            }

            if ((bizType == "combined application"))
            {
                NgWebElement uiPreviousLicenceYes = ngDriver.FindElement(By.Id("mat-button-toggle-55-button"));
                JavaScriptClick(uiPreviousLicenceYes);
            }

            // enter the previous application details
            NgWebElement uiPreviousApplicationDetails = ngDriver.FindElement(By.Id("previousApplicationDetails"));

            uiPreviousApplicationDetails.SendKeys(prevAppDetails);

            // select 'Yes'
            // Do you hold a Rural Agency Store Appointment?
            if ((bizType == "private corporation") || (bizType == "partnership") || (bizType == "society") || (bizType == "public corporation") || (bizType == "sole proprietorship"))
            {
                NgWebElement uiRuralAgencyStore = ngDriver.FindElement(By.Id("mat-button-toggle-76-button"));
                JavaScriptClick(uiRuralAgencyStore);
            }

            if ((bizType == "combined application"))
            {
                NgWebElement uiRuralAgencyStore = ngDriver.FindElement(By.Id("mat-button-toggle-58-button"));
                uiRuralAgencyStore.Click();
            }

            // select 'Yes'
            // Do you, or any of your shareholders, have any connection, financial or otherwise, direct or indirect, with a distillery, brewery or winery?
            if ((bizType == "private corporation") || (bizType == "partnership") || (bizType == "society") || (bizType == "public corporation") || (bizType == "sole proprietorship"))
            {
                NgWebElement uiOtherBusinessYes = ngDriver.FindElement(By.Id("mat-button-toggle-79-button"));
                JavaScriptClick(uiOtherBusinessYes);
            }

            if ((bizType == "combined application"))
            {
                NgWebElement uiOtherBusinessYes = ngDriver.FindElement(By.Id("mat-button-toggle-61-button"));
                uiOtherBusinessYes.Click();
            }

            // enter the connection details
            NgWebElement uiLiqIndConnection = ngDriver.FindElement(By.Id("liquorIndustryConnectionsDetails"));

            uiLiqIndConnection.SendKeys(liqConnectionDetails);

            // enter the kitchen details
            NgWebElement uiKitchenDescription = ngDriver.FindElement(By.CssSelector("textarea#description2"));

            uiKitchenDescription.SendKeys(kitchenDetails);

            // enter the transport details
            NgWebElement uiTransportDetails = ngDriver.FindElement(By.CssSelector("textarea#description3"));

            uiTransportDetails.SendKeys(transportDetails);

            if ((bizType == "partnership") || (bizType == "society"))
            {
                // upload a store signage document
                FileUpload("signage.pdf", "(//input[@type='file'])[8]");

                // upload a valid interest document
                FileUpload("valid_interest.pdf", "(//input[@type='file'])[12]");
            }

            if ((bizType == "private corporation") || (bizType == "combined application") || (bizType == "public corporation"))
            {
                // upload a store signage document
                FileUpload("signage.pdf", "(//input[@type='file'])[17]");

                // upload a valid interest document
                FileUpload("valid_interest.pdf", "(//input[@type='file'])[21]");
            }

            if (bizType == "sole proprietorship")
            {
                // upload a store signage document
                FileUpload("signage.pdf", "(//input[@type='file'])[5]");

                // upload a valid interest document
                FileUpload("valid_interest.pdf", "(//input[@type='file'])[9]");
            }

            // enter the first name of the application contact
            NgWebElement uiContactGiven = ngDriver.FindElement(By.Id("contactPersonFirstName"));

            uiContactGiven.SendKeys(conGiven);

            // enter the last name of the application contact
            NgWebElement uiContactSurname = ngDriver.FindElement(By.Id("contactPersonLastName"));

            uiContactSurname.SendKeys(conSurname);

            // enter the role of the application contact
            NgWebElement uiContactRole = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonRole']"));

            uiContactRole.SendKeys(conRole);

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

            uiContactPhone.SendKeys(conPhone);

            // enter the email of the application contact
            NgWebElement uiContactEmail = ngDriver.FindElement(By.Id("contactPersonEmail"));

            uiContactEmail.SendKeys(conEmail);

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

            uiAuthorizedToSubmit.Click();

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

            uiSignatureAgreement.Click();

            // retrieve the current URL to get the application ID (needed downstream)
            string URL = ngDriver.Url;

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

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

            applicationID = tempFix[0];
        }
示例#7
0
        public void CompleteOffsiteStorage()
        {
            /*
             * Page Title: Manage Off-Site Storage
             */

            // create test data
            string location1 = "LCRB1";
            string street1   = "645 Tyee Road";
            string city1     = "Victoria";
            string postal1   = "V9A6X5";

            string location2 = "LCRB2";
            string street2   = "645 Tyee St";
            string city2     = "Duncan";
            string postal2   = "V9L1W4";

            string location3 = "LCRB3";
            string street3   = "645 Tyee Road";
            string city3     = "Umpqua";
            string postal3   = "97486";

            string location4 = "LCRB4";
            string street4   = "645 Champion Drive";
            string city4     = "Vancouver";
            string postal4   = "V5H3Z7";

            string location5 = "LCRB5";
            string street5   = "645 Chief St";
            string city5     = "Port Hardy";
            string postal5   = "V0N 2P0";

            // click on Add Additional Storage button
            NgWebElement uiOffsiteStorageLocations = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] button[type='button']"));

            uiOffsiteStorageLocations.Click();

            // enter location 1
            NgWebElement uiLocation1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] input[formcontrolname='name']"));

            uiLocation1.SendKeys(location1);

            // enter street 1
            NgWebElement uiStreet1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] input[formcontrolname='street1']"));

            uiStreet1.SendKeys(street1);

            // enter city 1
            NgWebElement uiCity1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] input[formcontrolname='city']"));

            uiCity1.SendKeys(city1);

            // enter postal code 1
            NgWebElement uiPostalCode1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] input[formcontrolname='postalCode']"));

            uiPostalCode1.SendKeys(postal1);

            // open second row
            NgWebElement uiSecondRow = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] button.btn-secondary"));

            uiSecondRow.Click();

            // enter location 2
            NgWebElement uiLocation2 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[5]"));

            uiLocation2.SendKeys(location2);

            // enter street 2
            NgWebElement uiStreet2 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[6]"));

            uiStreet2.SendKeys(street2);

            // enter city 2
            NgWebElement uiCity2 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[7]"));

            uiCity2.SendKeys(city2);

            // enter postal code 2
            NgWebElement uiPostalCode2 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[8]"));

            uiPostalCode2.SendKeys(postal2);

            // open third row
            NgWebElement uiThirdRow = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] button.btn-secondary"));

            uiThirdRow.Click();

            // enter location 3
            NgWebElement uiLocation3 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[9]"));

            uiLocation3.SendKeys(location3);

            // enter street 3
            NgWebElement uiStreet3 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[10]"));

            uiStreet3.SendKeys(street3);

            // enter city 3
            NgWebElement uiCity3 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[11]"));

            uiCity3.SendKeys(city3);

            // enter postal code 3
            NgWebElement uiPostalCode3 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[12]"));

            uiPostalCode3.SendKeys(postal3);

            // open fourth row
            NgWebElement uiFourthRow = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] button.btn-secondary"));

            uiFourthRow.Click();

            // enter location 4
            NgWebElement uiLocation4 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[13]"));

            uiLocation4.SendKeys(location4);

            // enter street 4
            NgWebElement uiStreet4 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[14]"));

            uiStreet4.SendKeys(street4);

            // enter city 4
            NgWebElement uiCity4 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[15]"));

            uiCity4.SendKeys(city4);

            // enter postal code 4
            NgWebElement uiPostalCode4 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[16]"));

            uiPostalCode4.SendKeys(postal4);

            // open fifth row
            NgWebElement uiFifthRow = ngDriver.FindElement(By.CssSelector("[formcontrolname='offsiteStorageLocations'] button.btn-secondary"));

            uiFifthRow.Click();

            // enter location 5
            NgWebElement uiLocation5 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[17]"));

            uiLocation5.SendKeys(location5);

            // enter street 5
            NgWebElement uiStreet5 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[18]"));

            uiStreet5.SendKeys(street5);

            // enter city 5
            NgWebElement uiCity5 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[19]"));

            uiCity5.SendKeys(city5);

            // enter postal code 5
            NgWebElement uiPostalCode5 = ngDriver.FindElement(By.XPath("(//input[@type='text'])[20]"));

            uiPostalCode5.SendKeys(postal5);

            // click on the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='agreement']"));

            uiSignatureAgreement.Click();
        }
        public void MarketEvents(string frequency)
        {
            /*
             * Page Title: Licences & Authorizations
             */

            // refresh page required for link display
            ngDriver.Navigate().Refresh();

            string marketEvent = "Request Market Event Authorization";

            // click on the Request Market Event Authorization link
            NgWebElement uiOnSiteStoreEndorsement = ngDriver.FindElement(By.LinkText(marketEvent));

            uiOnSiteStoreEndorsement.Click();

            /*
             * Page Title: Market Authorization Request
             */

            // create test data
            string contactName         = "Test Automation";
            string contactPhoneNumber  = "(222) 222-2222";
            string contactEmail        = "*****@*****.**";
            string marketName          = "Point Ellis Market";
            string marketWebsite       = "http://www.pointellismarketisamazing.com";
            string bizLegalName        = "Point Ellis Market Cooperative";
            string marketBizNumber     = "2222222222222222";
            string incorporationNumber = "1234567";
            string address1            = "645 Tyee Road";
            string address2            = "West";
            string city                  = "Victoria";
            string postalCode            = "V9A 6X5";
            string additionalDetails     = "Additional details for automated test.";
            string additionalInformation = "Additional information for automated test.";

            // select preventing sale of liquor checkbox
            NgWebElement uiPreventingSaleOfLiquor = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isNoPreventingSaleofLiquor']"));

            uiPreventingSaleOfLiquor.Click();

            // select market managed or carried checkbox
            NgWebElement uiMarketManagedOrCarried = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isMarketManagedorCarried']"));

            uiMarketManagedOrCarried.Click();

            // select market only vendors checkbox
            NgWebElement uiIsMarketOnlyVendors = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isMarketOnlyVendors']"));

            uiIsMarketOnlyVendors.Click();

            // select imported goods checkbox
            NgWebElement uiIsNoImportedGoods = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isNoImportedGoods']"));

            uiIsNoImportedGoods.Click();

            // select six vendors checkbox
            NgWebElement uiIsMarketHostsSixVendors = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isMarketHostsSixVendors']"));

            uiIsMarketHostsSixVendors.Click();

            // select max amount or duration checkbox
            NgWebElement uiIsMarketMaxAmountorDuration = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isMarketMaxAmountorDuration']"));

            uiIsMarketMaxAmountorDuration.Click();

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

            uiContactName.SendKeys(contactName);

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

            uiContactPhoneNumber.SendKeys(contactPhoneNumber);

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

            uiContactEmail.SendKeys(contactEmail);

            // enter market name
            NgWebElement uiMarketName = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'marketName']"));

            uiMarketName.SendKeys(marketName);

            // enter market website
            NgWebElement uiMarketWebsite = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'marketWebsite']"));

            uiMarketWebsite.SendKeys(marketWebsite);

            // enter business legal name
            NgWebElement uiClientHostname = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'clientHostname']"));

            uiClientHostname.SendKeys(bizLegalName);

            // select market event type (annual)
            NgWebElement uiMarketEventType = ngDriver.FindElement(By.CssSelector("[formcontrolname= 'marketEventType'] option[value = '2: 845280002']"));

            uiMarketEventType.Click();

            // enter market business number
            NgWebElement uiBusinessNumber = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'businessNumber']"));

            uiBusinessNumber.SendKeys(marketBizNumber);

            // enter incorporation/registration number
            NgWebElement uiRegistrationNumber = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'registrationNumber']"));

            uiRegistrationNumber.SendKeys(incorporationNumber);

            // enter address 1
            NgWebElement uiStreet1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'street1']"));

            uiStreet1.SendKeys(address1);

            // enter address 2
            NgWebElement uiStreet2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'street2']"));

            uiStreet2.SendKeys(address2);

            // enter city
            NgWebElement uiCity = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'city']"));

            uiCity.SendKeys(city);

            // enter postal code
            NgWebElement uiPostalCode = ngDriver.FindElement(By.CssSelector("input[formcontrolname = 'postalCode']"));

            uiPostalCode.SendKeys(postalCode);

            // enter additional details
            NgWebElement uiAdditionalDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='venueDescription']"));

            uiAdditionalDetails.SendKeys(additionalDetails);

            // select 'Once' from the frequency dropdown
            if (frequency == "for one date only")
            {
                // select frequency
                NgWebElement uiFrequency = ngDriver.FindElement(By.CssSelector("[formcontrolname='marketDuration'] option[value='3: 845280003']"));
                uiFrequency.Click();
            }

            // select 'Weekly' from the frequency dropdown
            if (frequency == "weekly")
            {
                // select frequency
                NgWebElement uiFrequency = ngDriver.FindElement(By.CssSelector("[formcontrolname='marketDuration'] option[value='0: 845280000']"));
                uiFrequency.Click();
            }

            // select 'Bi-Weekly' from the frequency dropdown
            if (frequency == "bi-weekly")
            {
                // select frequency
                NgWebElement uiFrequency = ngDriver.FindElement(By.CssSelector("[formcontrolname='marketDuration'] option[value='1: 845280001']"));
                uiFrequency.Click();
            }

            // select 'Monthly' from the frequency dropdown
            if (frequency == "monthly")
            {
                // select frequency
                NgWebElement uiFrequency = ngDriver.FindElement(By.CssSelector("[formcontrolname='marketDuration'] option[value='2: 845280002']"));
                uiFrequency.Click();
            }

            // enter additional information
            NgWebElement uiAdditionalInformation = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='additionalLocationInformation']"));

            uiAdditionalInformation.SendKeys(additionalInformation);

            // select end date
            NgWebElement uiEndDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='endDate']"));

            uiEndDate1.Click();

            // click on the next button
            NgWebElement uiOpenCalendarNext = ngDriver.FindElement(By.CssSelector(".mat-calendar .mat-calendar-next-button"));

            JavaScriptClick(uiOpenCalendarNext);

            if (frequency == "monthly")
            {
                // click on the next button again
                NgWebElement uiOpenCalendarNext2 = ngDriver.FindElement(By.CssSelector(".mat-calendar .mat-calendar-next-button"));
                JavaScriptClick(uiOpenCalendarNext2);
            }

            // click on the first day
            NgWebElement uiOpenCalendarYear = ngDriver.FindElement(By.CssSelector(".mat-calendar-content .mat-calendar-body-cell-content:first-child"));

            JavaScriptClick(uiOpenCalendarYear);

            // select start date
            NgWebElement uiStartDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='startDate']"));

            uiStartDate1.Click();

            try
            {
                NgWebElement uiStartDate2 = ngDriver.FindElement(By.CssSelector(".mat-calendar-body-cell-content.mat-calendar-body-today"));
                uiStartDate2.Click();
            }
            catch
            {
                // retry if failed once
                NgWebElement uiStartDate2 = ngDriver.FindElement(By.CssSelector(".mat-calendar-body-cell-content.mat-calendar-body-today"));
                uiStartDate2.Click();
            }

            if (frequency != "for one date only")
            {
                // confirm that all days are available for selection; de-selection is required due to days per week limit
                NgWebElement uiSunday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-10 .mat-checkbox-inner-container"));
                JavaScriptClick(uiSunday);
                NgWebElement uiSunday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-10 .mat-checkbox-inner-container"));
                JavaScriptClick(uiSunday2);

                NgWebElement uiMonday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-11 .mat-checkbox-inner-container"));
                JavaScriptClick(uiMonday);
                NgWebElement uiMonday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-11 .mat-checkbox-inner-container"));
                JavaScriptClick(uiMonday2);

                NgWebElement uiTuesday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-12 .mat-checkbox-inner-container"));
                JavaScriptClick(uiTuesday);
                NgWebElement uiTuesday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-12 .mat-checkbox-inner-container"));
                JavaScriptClick(uiTuesday2);

                NgWebElement uiWednesday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-13 .mat-checkbox-inner-container"));
                JavaScriptClick(uiWednesday);
                NgWebElement uiWednesday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-13 .mat-checkbox-inner-container"));
                JavaScriptClick(uiWednesday2);

                NgWebElement uiThursday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-14 .mat-checkbox-inner-container"));
                JavaScriptClick(uiThursday);
                NgWebElement uiThursday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-14 .mat-checkbox-inner-container"));
                JavaScriptClick(uiThursday2);

                NgWebElement uiFriday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-15 .mat-checkbox-inner-container"));
                JavaScriptClick(uiFriday);
                NgWebElement uiFriday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-15 .mat-checkbox-inner-container"));
                JavaScriptClick(uiFriday2);

                NgWebElement uiSaturday = ngDriver.FindElement(By.CssSelector("#mat-checkbox-16 .mat-checkbox-inner-container"));
                JavaScriptClick(uiSaturday);
                NgWebElement uiSaturday2 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-16 .mat-checkbox-inner-container"));
                JavaScriptClick(uiSaturday2);

                if ((frequency == "weekly") || (frequency == "bi-weekly"))
                {
                    // make final selection re days of the week
                    NgWebElement uiThursdayFinal = ngDriver.FindElement(By.CssSelector("#mat-checkbox-14 .mat-checkbox-inner-container"));
                    JavaScriptClick(uiThursdayFinal);

                    NgWebElement uiFridayFinal = ngDriver.FindElement(By.CssSelector("#mat-checkbox-15 .mat-checkbox-inner-container"));
                    JavaScriptClick(uiFridayFinal);

                    NgWebElement uiSaturdayFinal = ngDriver.FindElement(By.CssSelector("#mat-checkbox-16 .mat-checkbox-inner-container"));
                    JavaScriptClick(uiSaturdayFinal);
                }

                if (frequency == "monthly")
                {
                    // select day of the week
                    NgWebElement uiSaturday3 = ngDriver.FindElement(By.CssSelector("#mat-checkbox-16 .mat-checkbox-inner-container"));
                    JavaScriptClick(uiSaturday3);

                    // select first week of the month
                    NgWebElement uiWeekOfMonth1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='weekOfMonth'] [for='mat-radio-2-input']"));
                    JavaScriptClick(uiWeekOfMonth1);

                    // select second week of the month
                    NgWebElement uiWeekOfMonth2 = ngDriver.FindElement(By.CssSelector("[formcontrolname='weekOfMonth'] [for='mat-radio-3-input']"));
                    JavaScriptClick(uiWeekOfMonth2);

                    // select third week of the month
                    NgWebElement uiWeekOfMonth3 = ngDriver.FindElement(By.CssSelector("[formcontrolname='weekOfMonth'] [for='mat-radio-4-input']"));
                    JavaScriptClick(uiWeekOfMonth3);

                    // select fourth week of the month
                    NgWebElement uiWeekOfMonth4 = ngDriver.FindElement(By.CssSelector("[formcontrolname='weekOfMonth'] [for='mat-radio-5-input']"));
                    JavaScriptClick(uiWeekOfMonth4);
                }
            }

            // decrement event start hour
            NgWebElement uiEventStartHour = ngDriver.FindElement(By.CssSelector("[formcontrolname='startTime'] .ngb-tp-hour [type='button'] span.bottom"));

            JavaScriptClick(uiEventStartHour);

            // decrement event start minute
            NgWebElement uiEventStartMinute = ngDriver.FindElement(By.CssSelector("[formcontrolname='startTime'] .ngb-tp-minute span.ngb-tp-chevron.bottom"));

            JavaScriptClick(uiEventStartMinute);

            // decrement event end hour
            NgWebElement uiEventEndHour = ngDriver.FindElement(By.CssSelector("[formcontrolname='endTime'] .ngb-tp-hour [type='button'] span.bottom"));

            JavaScriptClick(uiEventEndHour);

            // decrement event end minute
            NgWebElement uiEventEndMinute = ngDriver.FindElement(By.CssSelector("[formcontrolname='endTime'] .ngb-tp-minute [type='button'] span.bottom"));

            JavaScriptClick(uiEventEndMinute);

            // increment liquor sale start hour
            NgWebElement uiLiquorStartHour = ngDriver.FindElement(By.CssSelector(".col-md-2:nth-child(4) .ngb-tp-hour .ng-star-inserted:nth-child(1) .ngb-tp-chevron"));

            JavaScriptClick(uiLiquorStartHour);

            // increment liquor sale start minute
            NgWebElement uiLiquorStartMinute = ngDriver.FindElement(By.CssSelector(".col-md-2:nth-child(4) .ngb-tp-minute .ng-star-inserted:nth-child(1) .ngb-tp-chevron"));

            JavaScriptClick(uiLiquorStartMinute);

            // double decrement liquor sale end hour
            NgWebElement uiLiquorEndHour1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='liquorEndTime'] .ngb-tp-hour span.bottom"));

            JavaScriptClick(uiLiquorEndHour1);
            JavaScriptClick(uiLiquorEndHour1);

            // double decrement liquor sale end minute
            NgWebElement uiLiquorEndMinute1 = ngDriver.FindElement(By.CssSelector("[formcontrolname='liquorEndTime'] .ngb-tp-minute span.bottom"));

            JavaScriptClick(uiLiquorEndMinute1);
            JavaScriptClick(uiLiquorEndMinute1);

            // select agreement checkbox
            NgWebElement uiAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='agreement']"));

            uiAgreement.Click();

            // select serving it right/minors checkbox
            NgWebElement uiServingItRight = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isAllStaffServingitRight']"));

            uiServingItRight.Click();

            // select sample sizes checkbox
            NgWebElement uiSampleSizes = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isSampleSizeCompliant']"));

            uiSampleSizes.Click();
        }
        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();
        }
示例#10
0
        public void CompleteCannabisApplication(string businessType)
        {
            /*
             * Page Title: Submit the Cannabis Retail Store Application
             */

            // create application info
            string estName            = "Point Ellis Greenhouse";
            string estAddress         = "645 Tyee Rd";
            string estCity            = "Victoria";
            string estPostal          = "V9A 6X5";
            string estPID             = "012345678";
            string estEmail           = "*****@*****.**";
            string estPhone           = "2505555555";
            string conRole            = "CEO";
            string conPhone           = "2508888888";
            string conEmail           = "*****@*****.**";
            string indigenousNation   = "Cowichan Tribes";
            string policeJurisdiction = "RCMP Shawnigan Lake";

            if (businessType != " sole proprietorship")
            {
                // upload a central securities register
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[3]");

                // upload supporting business documentation
                FileUpload("associates.pdf", "(//input[@type='file'])[6]");

                // upload notice of articles
                FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[9]");
            }

            // upload cannabis associate screening form
            if (businessType == " sole proprietorship")
            {
                FileUpload("cannabis_associate_security_screening.pdf", "(//input[@type='file'])[3]");
            }
            else
            {
                FileUpload("cannabis_associate_security_screening.pdf", "(//input[@type='file'])[12]");
            }

            // upload financial integrity form
            if (businessType == " sole proprietorship")
            {
                FileUpload("fin_integrity.pdf", "(//input[@type='file'])[6]");
            }
            else
            {
                FileUpload("fin_integrity.pdf", "(//input[@type='file'])[15]");
            }

            // upload shareholders < 10% interest
            if (businessType != " sole proprietorship")
            {
                FileUpload("shareholders_less_10_interest.pdf", "(//input[@type='file'])[18]");
            }

            // enter the establishment name
            NgWebElement uiEstabName = ngDriver.FindElement(By.Id("establishmentName"));

            uiEstabName.SendKeys(estName);

            // enter the establishment address
            NgWebElement uiEstabAddress = ngDriver.FindElement(By.Id("establishmentAddressStreet"));

            uiEstabAddress.SendKeys(estAddress);

            // enter the establishment city
            NgWebElement uiEstabCity = ngDriver.FindElement(By.Id("establishmentAddressCity"));

            uiEstabCity.SendKeys(estCity);

            // enter the establishment postal code
            NgWebElement uiEstabPostal = ngDriver.FindElement(By.Id("establishmentAddressPostalCode"));

            uiEstabPostal.SendKeys(estPostal);

            // enter the PID
            NgWebElement uiEstabPID = ngDriver.FindElement(By.Id("establishmentParcelId"));

            uiEstabPID.SendKeys(estPID);

            // search for and select the indigenous nation
            NgWebElement uiIndigenousNation = ngDriver.FindElement(By.CssSelector("input[formcontrolname='indigenousNation']"));

            uiIndigenousNation.SendKeys(indigenousNation);

            NgWebElement uiIndigenousNation2 = ngDriver.FindElement(By.CssSelector("#mat-option-0 span"));

            JavaScriptClick(uiIndigenousNation2);

            // search for and select the police jurisdiction
            NgWebElement uiPoliceJurisdiction = ngDriver.FindElement(By.CssSelector("input[formcontrolname='policeJurisdiction']"));

            uiPoliceJurisdiction.SendKeys(policeJurisdiction);

            NgWebElement uiPoliceJurisdiction2 = ngDriver.FindElement(By.CssSelector("#mat-option-2 span"));

            uiPoliceJurisdiction2.Click();

            // enter the store email
            NgWebElement uiEstabEmail = ngDriver.FindElement(By.Id("establishmentEmail"));

            uiEstabEmail.SendKeys(estEmail);

            // enter the store phone number
            NgWebElement uiEstabPhone = ngDriver.FindElement(By.Id("establishmentPhone"));

            uiEstabPhone.SendKeys(estPhone);

            // upload a store signage document
            if (businessType == " sole proprietorship")
            {
                FileUpload("signage.pdf", "(//input[@type='file'])[8]");
            }
            else
            {
                FileUpload("signage.pdf", "(//input[@type='file'])[20]");
            }

            // select not visible from outside checkbox
            NgWebElement uiVisibleFromOutside = ngDriver.FindElement(By.CssSelector(".mat-checkbox-inner-container"));

            uiVisibleFromOutside.Click();

            // upload a floor plan document
            if (businessType == " sole proprietorship")
            {
                FileUpload("floor_plan.pdf", "(//input[@type='file'])[11]");
            }
            else
            {
                FileUpload("floor_plan.pdf", "(//input[@type='file'])[23]");
            }

            // upload a site plan document
            if (businessType == " sole proprietorship")
            {
                FileUpload("site_plan.pdf", "(//input[@type='file'])[14]");
            }
            else
            {
                FileUpload("site_plan.pdf", "(//input[@type='file'])[26]");
            }

            // upload a financial integrity form
            if (businessType == " sole proprietorship")
            {
                FileUpload("fin_integrity.pdf", "(//input[@type='file'])[18]");
            }
            else
            {
                FileUpload("fin_integrity.pdf", "(//input[@type='file'])[30]");
            }

            // upload a ownership details document
            if (businessType == " private corporation")
            {
                FileUpload("ownership_details.pdf", "(//input[@type='file'])[33]");
            }

            // upload a ownership details document
            if (businessType != " sole proprietorship")
            {
                FileUpload("ownership_details.pdf", "(//input[@type='file'])[33]");
            }

            // upload a ownership details document
            if (businessType == " sole proprietorship")
            {
                FileUpload("ownership_details.pdf", "(//input[@type='file'])[21]");
            }

            // enter the role of the application contact
            NgWebElement uiContactRole = ngDriver.FindElement(By.CssSelector("input[formControlName=contactPersonRole]"));

            uiContactRole.SendKeys(conRole);

            // enter the phone number of the application contact
            NgWebElement uiContactPhone = ngDriver.FindElement(By.CssSelector("input[formControlName=contactPersonPhone]"));

            uiContactPhone.SendKeys(conPhone);

            // enter the email of the application contact
            NgWebElement uiContactEmail = ngDriver.FindElement(By.Id("contactPersonEmail"));

            uiContactEmail.SendKeys(conEmail);

            // 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();

            // retrieve the current URL to get the application ID (needed downstream)
            string URL = ngDriver.Url;

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

            applicationID = parsedURL[5];
        }
        public void RenewLicence(string responses)
        {
            if (responses == "negative responses for Cannabis")
            {
                // select 'No'
                // 1. Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB?
                NgWebElement uiCriminalOffence = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-10-button"));
                JavaScriptClick(uiCriminalOffence);

                // select 'No'
                // 2. Has there been an unreported sale of the business associated with the licence within the past 12 months?
                NgWebElement uiUnreportedSale = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-12-button"));
                JavaScriptClick(uiUnreportedSale);

                // select 'No'
                // 3. Our records show that this establishment is licensed as a Private Corporation. Has this changed?
                NgWebElement uiBusinessType = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBusinessType'] button#mat-button-toggle-14-button"));
                JavaScriptClick(uiBusinessType);

                // select 'No'
                // 4. Have you, any partner, shareholder, director, officer, or an immediate family member of any of the aforementioned associates acquired a new interest or expanded an existing interest - financial or otherwise - in a federal producer of cannabis within the past 12 months?
                NgWebElement uiTiedHouse = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-16-button"));
                JavaScriptClick(uiTiedHouse);

                // select 'No'
                // 5. Has a federal produce of cannabis acquired a new interest or expanded an existing interest - financial or otherwise - in the licensee Private Corporation within the past 12 months?
                NgWebElement uiTiedHouseFederalInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='tiedhouseFederalInterest'] button#mat-button-toggle-18-button"));
                JavaScriptClick(uiTiedHouseFederalInterest);

                // select 'No'
                // 6. Have you made any unreported changes to your organizational leadership within the past 12 months?
                NgWebElement uiOrgLeadership = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalOrgLeadership'] button#mat-button-toggle-20-button"));
                JavaScriptClick(uiOrgLeadership);

                // select 'No'
                // 7. Have you made any unreported changes to your key personnel within the past 12 months?
                NgWebElement uiKeyPersonnel = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-22-button"));
                JavaScriptClick(uiKeyPersonnel);

                // select 'No'
                // 8. Have you made any unreported changes to your share structure within the past 12 months?
                NgWebElement uiShareholderStructure = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-24-button"));
                JavaScriptClick(uiShareholderStructure);

                // select 'No'
                // 9. Do you have an outstanding payable fine under the Offence Act or outstanding payable monetary penalty under the Cannabis Control and Licensing Act that has not yet been paid?
                NgWebElement uiOutstandingFine = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalOutstandingFines'] button#mat-button-toggle-26-button"));
                JavaScriptClick(uiOutstandingFine);

                // select 'No'
                // 10. Have you made an unreported change to your store’s name in the past 12 months?
                NgWebElement uiBrandingChange = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBranding'] button#mat-button-toggle-34-button"));
                JavaScriptClick(uiBrandingChange);

                // select 'No'
                // 11. Have you updated the store’s signage or branding in the past 12 months?
                NgWebElement uiSignageChange = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalSignage'] button#mat-button-toggle-36-button"));
                JavaScriptClick(uiSignageChange);

                // select 'No'
                // 12. Have you made an unreported change of location of your establishment within the past 12 months? (This includes any changes to the Parcel Identification Number where your establishment is located, even if the physical location has not changed).
                NgWebElement uiEstablishmentAddress = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalEstablishmentAddress'] button#mat-button-toggle-38-button"));
                JavaScriptClick(uiEstablishmentAddress);

                // select 'No'
                // 13. Have you sold the property or transferred the lease associated with this cannabis retail store licence within the past 12 months?
                NgWebElement uiValidInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-40-button"));
                JavaScriptClick(uiValidInterest);

                // select 'No'
                // 14. Are you aware of any local government or Indigenous nation zoning changes with respect to your establishment location?
                NgWebElement uiZoning = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalZoning'] button#mat-button-toggle-42-button"));
                JavaScriptClick(uiZoning);

                // select 'No'
                // 15. Have you made any unreported changes to the store’s floor plan within the past 12 months?
                NgWebElement uiFloorPlan = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-44-button"));
                JavaScriptClick(uiFloorPlan);
            }

            if (responses == "positive responses for Cannabis")
            {
                // select 'Yes'
                // 1. Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB?
                NgWebElement uiCriminalOffence = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-9-button"));
                JavaScriptClick(uiCriminalOffence);

                // select 'Yes'
                // 2. Has there been an unreported sale of the business associated with the licence within the past 12 months?
                NgWebElement uiUnreportedSale = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-11-button"));
                JavaScriptClick(uiUnreportedSale);

                // select 'Yes'
                // 3. Our records show that this establishment is licensed as a Private Corporation. Has this changed?
                NgWebElement uiBusinessType = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBusinessType'] button#mat-button-toggle-13-button"));
                JavaScriptClick(uiBusinessType);

                // select 'Yes'
                // 4. Have you, any partner, shareholder, director, officer, or an immediate family member of any of the aforementioned associates acquired a new interest or expanded an existing interest - financial or otherwise - in a federal producer of cannabis within the past 12 months?
                NgWebElement uiTiedHouse = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-15-button"));
                JavaScriptClick(uiTiedHouse);

                // select 'Yes'
                // 5. Has a federal produce of cannabis acquired a new interest or expanded an existing interest - financial or otherwise - in the licensee Private Corporation within the past 12 months?
                NgWebElement uiTiedHouseFederalInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='tiedhouseFederalInterest'] button#mat-button-toggle-17-button"));
                JavaScriptClick(uiTiedHouseFederalInterest);

                // select 'Yes'
                // 6. Have you made any unreported changes to your organizational leadership within the past 12 months?
                NgWebElement uiOrgLeadership = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalOrgLeadership'] button#mat-button-toggle-19-button"));
                JavaScriptClick(uiOrgLeadership);

                // select 'Yes'
                // 7. Have you made any unreported changes to your key personnel within the past 12 months?
                NgWebElement uiKeyPersonnel = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-21-button"));
                JavaScriptClick(uiKeyPersonnel);

                // select 'Yes'
                // 8. Have you made any unreported changes to your share structure within the past 12 months?
                NgWebElement uiShareholderStructure = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-23-button"));
                JavaScriptClick(uiShareholderStructure);

                // select 'Yes'
                // 9. Do you have an outstanding payable fine under the Offence Act or outstanding payable monetary penalty under the Cannabis Control and Licensing Act that has not yet been paid?
                NgWebElement uiOutstandingFine = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalOutstandingFines'] button#mat-button-toggle-25-button"));
                JavaScriptClick(uiOutstandingFine);

                // select 'Yes'
                // 10. Have you made an unreported change to your store’s name in the past 12 months?
                NgWebElement uiBrandingChange = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBranding'] button#mat-button-toggle-33-button"));
                JavaScriptClick(uiBrandingChange);

                // select 'Yes'
                // 11. Have you updated the store’s signage or branding in the past 12 months?
                NgWebElement uiSignageChange = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalSignage'] button#mat-button-toggle-35-button"));
                JavaScriptClick(uiSignageChange);

                // select 'Yes'
                // 12. Have you made an unreported change of location of your establishment within the past 12 months? (This includes any changes to the Parcel Identification Number where your establishment is located, even if the physical location has not changed).
                NgWebElement uiEstablishmentAddress = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalEstablishmentAddress'] button#mat-button-toggle-37-button"));
                JavaScriptClick(uiEstablishmentAddress);

                // select 'Yes'
                // 13. Have you sold the property or transferred the lease associated with this cannabis retail store licence within the past 12 months?
                NgWebElement uiValidInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-39-button"));
                JavaScriptClick(uiValidInterest);

                // select 'Yes'
                // 14. Are you aware of any local government or Indigenous nation zoning changes with respect to your establishment location?
                NgWebElement uiZoning = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalZoning'] button#mat-button-toggle-41-button"));
                JavaScriptClick(uiZoning);

                // select 'Yes'
                // 15. Have you made any unreported changes to the store’s floor plan within the past 12 months?
                NgWebElement uiFloorPlan = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-43-button"));
                JavaScriptClick(uiFloorPlan);

                // confirm that correct information re positive responses for a Cannabis licensing renewal is displayed
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'You can still renew your licence. Please contact us as soon as possible to transfer this licence to its new owner. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'You can still renew your licence. Please contact us to update this information. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,' You can still renew your licence. After submitting your renewal, you can update your federal producer information on the Account Profile page on the Dashboard. A member of LCRB may contact you to determine any additional next steps. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,' You can still renew your licence. Please contact us to to pay your fines. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,' You can still renew your licence. After submitting your renewal, please start a Establishment Name or Branding Change application from the Dashboard. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'You can still renew your licence. After submitting your renewal, please start a Relocation Request application from the Dashboard. ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'A LCRB Licensing Staff member may contact you as part of this renewal process ')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,' You can still renew your licence. After submitting your renewal, please start a Structural Change Request application from the Dashboard. ')]")).Displayed);
            }

            if (responses == "negative responses for Catering")
            {
                // select 'No'
                // 1.Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB ?
                NgWebElement uiCriminalOffence = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-11-button"));
                JavaScriptClick(uiCriminalOffence);

                // select 'No'
                // 2. Have you or any of your partners, shareholders or directors of this establishment received any alcohol related driving infractions in the past 12 months?
                NgWebElement uiAlcoholInfraction = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalDUI'] button#mat-button-toggle-13-button"));
                JavaScriptClick(uiAlcoholInfraction);

                // select 'No'
                // 3. Our records show that this establishment is licensed as a PrivateCorporation. Has this changed?
                NgWebElement uiBusinessType = ngDriver.FindElement(By.CssSelector("[formcontrolname = 'renewalBusinessType'] button#mat-button-toggle-15-button"));
                JavaScriptClick(uiBusinessType);

                // select 'No'
                // 4. Have you redistributed any shares within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalShareholders = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-17-button"));
                JavaScriptClick(uiRenewalShareholders);

                // select 'No'
                // 5. Have you entered into an agreement allowing another person or business to use your licence within the past 12 months?
                NgWebElement uiRenewalThirdParty = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalThirdParty'] button#mat-button-toggle-19-button"));
                JavaScriptClick(uiRenewalThirdParty);

                // select 'No'
                // 6. Have you made any unreported structural changes to your establishment within the past 12 months?
                NgWebElement uiRenewalFloorPlan = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-21-button"));
                JavaScriptClick(uiRenewalFloorPlan);

                // select 'No'
                // 7. Have you acquired a new interest or expanded an existing interest financial or otherwise in a winery, brewery, distillery, liquor agent and/or a UBrew/UVin within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalTiedhouse = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-23-button"));
                JavaScriptClick(uiRenewalTiedhouse);

                // select 'No'
                // 8. Have you sold the business associated with this liquor licence within the last 12 months without notifying LCRB?
                NgWebElement uiRenewalUnreportedSaleOfBusiness = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-25-button"));
                JavaScriptClick(uiRenewalUnreportedSaleOfBusiness);

                // select 'No'
                // 9.Have you sold the property or transferred the lease associated with this liquor licence within the last 12 months?
                NgWebElement uiRenewalValidInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-27-button"));
                JavaScriptClick(uiRenewalValidInterest);

                // select 'No'
                // 10. Have you added, changed or removed a licensee representative within the past 12 months?
                NgWebElement uiRenewalKeyPersonnel = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-29-button"));
                JavaScriptClick(uiRenewalKeyPersonnel);
            }

            if (responses == "positive responses for Catering")
            {
                // select 'Yes'
                // 1.Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB ?
                NgWebElement uiCriminalOffence = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-10-button"));
                JavaScriptClick(uiCriminalOffence);

                // select 'Yes'
                // 2. Have you or any of your partners, shareholders or directors of this establishment received any alcohol related driving infractions in the past 12 months?
                NgWebElement uiAlcoholInfraction = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalDUI'] button#mat-button-toggle-12-button"));
                JavaScriptClick(uiAlcoholInfraction);

                // select 'Yes'
                // 3. Our records show that this establishment is licensed as a PrivateCorporation. Has this changed?
                NgWebElement uiBusinessType = ngDriver.FindElement(By.CssSelector("[formcontrolname = 'renewalBusinessType'] button#mat-button-toggle-14-button"));
                JavaScriptClick(uiBusinessType);

                // select 'Yes'
                // 4. Have you redistributed any shares within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalShareholders = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-16-button"));
                JavaScriptClick(uiRenewalShareholders);

                // select 'Yes'
                // 5. Have you entered into an agreement allowing another person or business to use your licence within the past 12 months?
                NgWebElement uiRenewalThirdParty = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalThirdParty'] button#mat-button-toggle-18-button"));
                JavaScriptClick(uiRenewalThirdParty);

                // select 'Yes'
                // 6. Have you made any unreported structural changes to your establishment within the past 12 months?
                NgWebElement uiRenewalFloorPlan = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-20-button"));
                JavaScriptClick(uiRenewalFloorPlan);

                // select 'Yes'
                // 7. Have you acquired a new interest or expanded an existing interest financial or otherwise in a winery, brewery, distillery, liquor agent and/or a UBrew/UVin within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalTiedhouse = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-22-button"));
                JavaScriptClick(uiRenewalTiedhouse);

                // select 'Yes'
                // 8. Have you sold the business associated with this liquor licence within the last 12 months without notifying LCRB?
                NgWebElement uiRenewalUnreportedSaleOfBusiness = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-24-button"));
                JavaScriptClick(uiRenewalUnreportedSaleOfBusiness);

                // select 'Yes'
                // 9.Have you sold the property or transferred the lease associated with this liquor licence within the last 12 months?
                NgWebElement uiRenewalValidInterest = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-26-button"));
                JavaScriptClick(uiRenewalValidInterest);

                // select 'Yes'
                // 10. Have you added, changed or removed a licensee representative within the past 12 months?
                NgWebElement uiRenewalKeyPersonnel = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-28-button"));
                JavaScriptClick(uiRenewalKeyPersonnel);

                // confirm that correct information re positive responses for a Catering licensing renewal is displayed
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Update your Shareholder Information on the Organization Details page')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Submit a Third Party Operator application from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Submit a Structural Change from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Update your Financial Interest information on the Account Profile')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Transfer this Licence from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Add, Remove or Update your Licensee Representative from the Licences Dashboard')]")).Displayed);
            }

            if ((responses == "positive responses for a brewery") || (responses == "positive responses for a winery") || (responses == "positive responses for a distillery") || (responses == "positive responses for a co-packer"))
            {
                string orderTotals     = "233";
                string confirmTotals   = "233";
                string volumeProduced  = "5000";
                string volumeDestroyed = "200";

                // enter the order totals
                NgWebElement uiOrderTotals = ngDriver.FindElement(By.CssSelector("input[formcontrolname='ldbOrderTotals']"));
                uiOrderTotals.SendKeys(orderTotals);

                // re-enter the order totals
                NgWebElement uiOrderTotals2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='ldbOrderTotalsConfirm']"));
                uiOrderTotals2.SendKeys(confirmTotals);

                if (responses == "positive responses for a winery")
                {
                    // click on manufacturer minimum checkbox
                    NgWebElement uiIsManufacturedMinimum = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isManufacturedMinimum']"));
                    JavaScriptClick(uiIsManufacturedMinimum);
                }

                if ((responses == "positive responses for a winery") || (responses == "positive responses for a brewery"))
                {
                    // enter the volume produced
                    NgWebElement uiVolumeProduced = ngDriver.FindElement(By.CssSelector("input[formcontrolname='volumeProduced']"));
                    uiVolumeProduced.SendKeys(volumeProduced);
                }

                if (responses == "positive responses for a winery")
                {
                    // enter the volume destroyed
                    NgWebElement uiVolumeDestroyed = ngDriver.FindElement(By.CssSelector("input[formcontrolname='volumeDestroyed']"));
                    uiVolumeDestroyed.SendKeys(volumeDestroyed);
                }

                // select 'Yes'
                // 1. Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB?
                NgWebElement uiRenewalCriminalOffenceCheckYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-10-button"));
                JavaScriptClick(uiRenewalCriminalOffenceCheckYes);

                // select 'Yes'
                // 2. Have you or any of your partners, shareholders or directors of this establishment received any alcohol related driving infractions in the past 12 months?
                NgWebElement uiRenewalDUIYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalDUI'] button#mat-button-toggle-12-button"));
                JavaScriptClick(uiRenewalDUIYes);

                // select 'Yes'
                // 3. Our records show that this establishment is licensed as a PrivateCorporation. Has this changed?
                NgWebElement uiRenewalBusinessTypeYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBusinessType'] button#mat-button-toggle-14-button"));
                JavaScriptClick(uiRenewalBusinessTypeYes);

                // select 'Yes'
                // 4. Have you redistributed any shares within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalShareholdersYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-16-button"));
                JavaScriptClick(uiRenewalShareholdersYes);

                // select 'Yes'
                // 5. Have you entered into an agreement allowing another person or business to use your licence within the past 12 months?
                NgWebElement uiRenewalThirdPartyYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalThirdParty'] button#mat-button-toggle-18-button"));
                JavaScriptClick(uiRenewalThirdPartyYes);

                // select 'Yes'
                // 6. Have you made any unreported structural changes to your establishment within the past 12 months?
                NgWebElement uiRenewalFloorPlanYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-20-button"));
                JavaScriptClick(uiRenewalFloorPlanYes);

                // select 'Yes'
                // 7. Have you acquired a new interest or expanded an existing interest financial or otherwise in a winery, brewery, distillery, liquor agent and/or a UBrew/UVin within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalTiedhouseYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-22-button"));
                JavaScriptClick(uiRenewalTiedhouseYes);

                // select 'Yes'
                // 8. Have you sold the business associated with this liquor licence within the last 12 months without notifying LCRB?
                NgWebElement uiRenewalUnreportedSaleOfBusinessYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-24-button"));
                JavaScriptClick(uiRenewalUnreportedSaleOfBusinessYes);

                // select 'Yes'
                // 9.Have you sold the property or transferred the lease associated with this liquor licence within the last 12 months?
                NgWebElement uiRenewalValidInterestYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-26-button"));
                JavaScriptClick(uiRenewalValidInterestYes);

                // select 'Yes'
                // 10. Have you added, changed or removed a licensee representative within the past 12 months?
                NgWebElement uiRenewalKeyPersonnelYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-28-button"));
                JavaScriptClick(uiRenewalKeyPersonnelYes);

                // confirm that correct information re positive responses for a Catering licensing renewal is displayed
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Update your Shareholder Information on the Organization Details page')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Submit a Third Party Operator application from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Submit a Structural Change from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Update your Financial Interest information on the Account Profile')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Transfer this Licence from the Licences Dashboard')]")).Displayed);
                Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'Add, Remove or Update your Licensee Representative from the Licences Dashboard')]")).Displayed);
            }

            if ((responses == "negative responses for a brewery") || (responses == "negative responses for a winery") || (responses == "negative responses for a distillery") || (responses == "negative responses for a co-packer"))
            {
                string orderTotals     = "233";
                string confirmTotals   = "233";
                string volumeProduced  = "5000";
                string volumeDestroyed = "200";

                // enter the order totals
                NgWebElement uiOrderTotals = ngDriver.FindElement(By.CssSelector("input[formcontrolname='ldbOrderTotals']"));
                uiOrderTotals.SendKeys(orderTotals);

                // re-enter the order totals
                NgWebElement uiOrderTotals2 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='ldbOrderTotalsConfirm']"));
                uiOrderTotals2.SendKeys(confirmTotals);

                if (responses == "negative responses for a winery")
                {
                    // click on manufacturer minimum checkbox
                    NgWebElement uiIsManufacturedMinimum = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isManufacturedMinimum']"));
                    JavaScriptClick(uiIsManufacturedMinimum);
                }

                if ((responses == "negative responses for a winery") || (responses == "negative responses for a brewery"))
                {
                    // enter the volume produced
                    NgWebElement uiVolumeProduced = ngDriver.FindElement(By.CssSelector("input[formcontrolname='volumeProduced']"));
                    uiVolumeProduced.SendKeys(volumeProduced);
                }

                if (responses == "negative responses for a winery")
                {
                    // enter the volume destroyed
                    NgWebElement uiVolumeDestroyed = ngDriver.FindElement(By.CssSelector("input[formcontrolname='volumeDestroyed']"));
                    uiVolumeDestroyed.SendKeys(volumeDestroyed);
                }

                // select 'No'
                // 1. Have you or any partner, shareholder, director, or officer of this licensee been arrested for, charged with, or convicted of a criminal offence within the past 12 months that you have not reported to the LCRB?
                NgWebElement uiRenewalCriminalOffenceCheckNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalCriminalOffenceCheck'] button#mat-button-toggle-11-button"));
                JavaScriptClick(uiRenewalCriminalOffenceCheckNo);

                // select 'No'
                // 2. Have you or any of your partners, shareholders or directors of this establishment received any alcohol related driving infractions in the past 12 months?
                NgWebElement uiRenewalDUINo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalDUI'] button#mat-button-toggle-13-button"));
                JavaScriptClick(uiRenewalDUINo);

                // select 'No'
                // 3. Our records show that this establishment is licensed as a PrivateCorporation. Has this changed?
                NgWebElement uiRenewalBusinessTypeNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalBusinessType'] button#mat-button-toggle-15-button"));
                JavaScriptClick(uiRenewalBusinessTypeNo);

                // select 'No'
                // 4. Have you redistributed any shares within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalShareholdersNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalShareholders'] button#mat-button-toggle-17-button"));
                JavaScriptClick(uiRenewalShareholdersNo);

                // select 'No'
                // 5. Have you entered into an agreement allowing another person or business to use your licence within the past 12 months?
                NgWebElement uiRenewalThirdPartyNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalThirdParty'] button#mat-button-toggle-19-button"));
                JavaScriptClick(uiRenewalThirdPartyNo);

                // select 'No'
                // 6. Have you made any unreported structural changes to your establishment within the past 12 months?
                NgWebElement uiRenewalFloorPlanNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalFloorPlan'] button#mat-button-toggle-21-button"));
                JavaScriptClick(uiRenewalFloorPlanNo);

                // select 'No'
                // 7. Have you acquired a new interest or expanded an existing interest financial or otherwise in a winery, brewery, distillery, liquor agent and/or a UBrew/UVin within the past 12 months without notifying LCRB?
                NgWebElement uiRenewalTiedhouseNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalTiedhouse'] button#mat-button-toggle-23-button"));
                JavaScriptClick(uiRenewalTiedhouseNo);

                // select 'No'
                // 8. Have you sold the business associated with this liquor licence within the last 12 months without notifying LCRB?
                NgWebElement uiRenewalUnreportedSaleOfBusinessNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalUnreportedSaleOfBusiness'] button#mat-button-toggle-25-button"));
                JavaScriptClick(uiRenewalUnreportedSaleOfBusinessNo);

                // select 'No'
                // 9.Have you sold the property or transferred the lease associated with this liquor licence within the last 12 months?
                NgWebElement uiRenewalValidInterestNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalValidInterest'] button#mat-button-toggle-27-button"));
                JavaScriptClick(uiRenewalValidInterestNo);

                // select 'No'
                // 10. Have you added, changed or removed a licensee representative within the past 12 months?
                NgWebElement uiRenewalKeyPersonnelNo = ngDriver.FindElement(By.CssSelector("[formcontrolname='renewalkeypersonnel'] button#mat-button-toggle-29-button"));
                JavaScriptClick(uiRenewalKeyPersonnelNo);
            }

            // temporary fix
            System.Threading.Thread.Sleep(5000);

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("input[formcontrolname='authorizedToSubmit'][type='checkbox']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("input[formcontrolname='signatureAgreement'][type='checkbox']"));

            uiSignatureAgreement.Click();

            // click on the Submit & Pay button
            NgWebElement uiSubmitAndPay = ngDriver.FindElement(By.CssSelector("button.btn-primary"));

            uiSubmitAndPay.Click();

            MakePayment();

            ClickLicencesTab();

            // reload Licences page as needed
            for (int i = 0; i < 5; i++)
            {
                try
                {
                    if ((ngDriver.FindElement(By.XPath("//body[contains(.,'Active')]")).Displayed == false))
                    {
                        ngDriver.Navigate().Refresh();
                        System.Threading.Thread.Sleep(2000);
                    }
                    else
                    {
                        break;
                    }
                }
                catch (Exception)
                {
                }
            }
        }
        public void RelocationChange()
        {
            /*
             * Page Title: Licences & Authorizations
             */

            string locationChange = "Request Relocation";

            // click on the Request Relocation link
            NgWebElement uiLocationChange = ngDriver.FindElement(By.LinkText(locationChange));

            uiLocationChange.Click();

            ContinueToApplicationButton();

            /*
             * Page Title: Manufacturer Relocation Application
             */

            // create test data
            string additionalPIDs  = "012345678, 343434344";
            string proposedChanges = "Details of proposed changes.";

            // enter additional PIDs
            NgWebElement uiAdditionalPIDs = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='pidList']"));

            uiAdditionalPIDs.SendKeys(additionalPIDs);

            // select the zoning checkbox
            NgWebElement uiZoningCheckbox = ngDriver.FindElement(By.CssSelector("mat-checkbox#mat-checkbox-2"));

            uiZoningCheckbox.Click();

            // enter the proposed changes
            NgWebElement uiProposedChanges = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='description1']"));

            uiProposedChanges.SendKeys(proposedChanges);

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

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

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

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

            // upload the ownership details
            FileUpload("ownership_details.pdf", "(//input[@type='file'])[15]");

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='authorizedToSubmit']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSignatureAgreement.Click();

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

            MakePayment();
        }
示例#13
0
        public void RequestLicenseeRepresentative()
        {
            /*
             * Page Title: Licences & Authorizations
             */

            // click on the Licensee Representative link
            string       addLicensee   = "Add Licensee Representative";
            NgWebElement uiAddLicensee = ngDriver.FindElement(By.LinkText(addLicensee));

            uiAddLicensee.Click();

            // create test data
            string representativeName = "Automated Test";
            string telephone          = "2005081818";
            string email = "*****@*****.**";

            // enter the representative name
            NgWebElement uiFullName = ngDriver.FindElement(By.CssSelector("input[formControlName='representativeFullName']"));

            uiFullName.SendKeys(representativeName);

            // enter the representative telephone number
            NgWebElement uiPhoneNumber = ngDriver.FindElement(By.CssSelector("input[formControlName='representativePhoneNumber']"));

            uiPhoneNumber.SendKeys(telephone);

            // enter the representative email address
            NgWebElement uiEmail = ngDriver.FindElement(By.CssSelector("input[formControlName='representativeEmail']"));

            uiEmail.SendKeys(email);

            System.Threading.Thread.Sleep(3000);

            try
            {
                // click on the submit permanent change applications checkbox
                NgWebElement uiCheckbox = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanSubmitPermanentChangeApplications']"));
                uiCheckbox.Click();
            }
            catch
            {
                // click on the submit permanent change applications checkbox
                NgWebElement uiCheckbox = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanSubmitPermanentChangeApplications']"));
                JavaScriptClick(uiCheckbox);
            }

            // click on the sign temporary change applications checkbox
            NgWebElement uiCheckbox1 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanSignTemporaryChangeApplications']"));

            JavaScriptClick(uiCheckbox1);

            // click on the obtain licence info from branch checkbox
            NgWebElement uiCheckbox2 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanObtainLicenceInformation']"));

            uiCheckbox2.Click();

            // click on sign grocery annual proof of sales revenue checkbox
            NgWebElement uiCheckbox3 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanSignGroceryStoreProofOfSale']"));

            uiCheckbox3.Click();

            // click on attend education sessions checkbox
            NgWebElement uiCheckbox4 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanAttendEducationSessions']"));

            uiCheckbox4.Click();

            // click on attend compliance meetings checkbox
            NgWebElement uiCheckbox5 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanAttendComplianceMeetings']"));

            uiCheckbox5.Click();

            // click on represent licensee at enforcement hearings checkbox
            NgWebElement uiCheckbox6 = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='representativeCanRepresentAtHearings']"));

            uiCheckbox6.Click();

            // click on the signature agreement checkbox
            NgWebElement uiSignatureAgree = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSignatureAgree.Click();

            NgWebElement uiSubmitButton = ngDriver.FindElement(By.CssSelector("button.btn-primary"));

            JavaScriptClick(uiSubmitButton);
        }
示例#14
0
 public void PressEnter()
 {
     entityField.SendKeys(Keys.Return);
 }
示例#15
0
        public void CompleteLRSApplication()
        {
            /*
             * Page Title: LRS Relocation Application
             */

            // create test data
            string proposedAddress    = "645 Tyee Road";
            string proposedCity       = "Victoria";
            string proposedPostalCode = "V9A 6X5";
            string proposedPID        = "111111111";

            // enter the proposed address
            NgWebElement uiProposedAddress = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentAddressStreet']"));

            uiProposedAddress.SendKeys(proposedAddress);

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

            uiProposedCity.SendKeys(proposedCity);

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

            uiProposedPostalCode.SendKeys(proposedPostalCode);

            // enter the proposed PID
            NgWebElement uiProposedPID = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentParcelId']"));

            uiProposedPID.SendKeys(proposedPID);

            // find the upload test files 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 the signage document
            string       signagePath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "signage.pdf");
            NgWebElement uiUploadSignage = ngDriver.FindElement(By.XPath("(//input[@type='file'])[2]"));

            uiUploadSignage.SendKeys(signagePath);

            // upload the floor plan
            string       floorPlanPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "floor_plan.pdf");
            NgWebElement uiUploadFloorPlan = ngDriver.FindElement(By.XPath("(//input[@type='file'])[5]"));

            uiUploadFloorPlan.SendKeys(floorPlanPath);

            // upload the site plan
            string       sitePlanPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "site_plan.pdf");
            NgWebElement uiUploadSitePlan = ngDriver.FindElement(By.XPath("(//input[@type='file'])[8]"));

            uiUploadSitePlan.SendKeys(sitePlanPath);

            // upload the exterior photos
            string       exteriorPhotosPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "exterior_photos.jpg");
            NgWebElement uiUploadExteriorPhotos = ngDriver.FindElement(By.XPath("(//input[@type='file'])[11]"));

            uiUploadExteriorPhotos.SendKeys(exteriorPhotosPath);

            // select 'Yes' for proposed LRS site located within a grocery store
            NgWebElement uiProposedSiteInGrocery = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-1 button#mat-button-toggle-1-button"));

            uiProposedSiteInGrocery.Click();

            // upload grocery declaration document
            string       groceryDeclarationPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "grocery_declaration.pdf");
            NgWebElement uiUploadGroceryDeclaration = ngDriver.FindElement(By.XPath("(//input[@type='file'])[15]"));

            uiUploadGroceryDeclaration.SendKeys(groceryDeclarationPath);

            // select the owner checkbox
            NgWebElement uiOwner = ngDriver.FindElement(By.CssSelector(".mat-checkbox[formcontrolname='isOwnerBusiness']"));

            uiOwner.Click();

            // select the valid interest checkbox
            NgWebElement uiValidInterest = ngDriver.FindElement(By.CssSelector(".mat-checkbox[formcontrolname='hasValidInterest']"));

            uiValidInterest.Click();

            // select the future valid interest checkbox
            NgWebElement uiFutureValidInterest = ngDriver.FindElement(By.CssSelector("mat-checkbox#mat-checkbox-4[formcontrolname='willhaveValidInterest']"));

            uiFutureValidInterest.Click();

            // upload valid interest document
            string       validInterestPath     = Path.Combine(projectDirectory2 + Path.DirectorySeparatorChar + "bdd-tests" + Path.DirectorySeparatorChar + "upload_files" + Path.DirectorySeparatorChar + "valid_interest.pdf");
            NgWebElement uiUploadValidInterest = ngDriver.FindElement(By.XPath("(//input[@type='file'])[18]"));

            uiUploadValidInterest.SendKeys(validInterestPath);

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("input[formcontrolname='authorizedToSubmit'][type='checkbox']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("input[formcontrolname='signatureAgreement'][type='checkbox']"));

            uiSignatureAgreement.Click();

            // click on the submit for LG/IN review button
            ClickOnSubmitButton();
        }
示例#16
0
 public LoginPage TypeEmail(string email)
 {
     emailField.SendKeys(email);
     return(this);
 }
示例#17
0
        public void CannabisMarketingApplication(string bizType)
        {
            string nameOfFederalProducer          = "Canadian Cannabis";
            string marketerConnectionToCrsDetails = "Details of association (marketer to store)";
            string crsConnectionToMarketer        = "Details of association (store to marketer)";
            string contactTitle = "VP Marketing";
            string contactPhone = "5555555555";
            string contactEmail = "vp@cannabis_marketing.com";

            if ((bizType != "a local government") && (bizType != "a university"))
            {
                // enter name of federal producer
                NgWebElement uiFederalProducer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='federalProducerNames']"));
                uiFederalProducer.SendKeys(nameOfFederalProducer);

                // select 'Yes'
                // Does the corporation have any association, connection or financial interest in a B.C. non-medical cannabis retail store licensee or applicant of cannabis?
                NgWebElement uiMarketerConnectionToCrs = ngDriver.FindElement(By.CssSelector("input[formcontrolname='marketerConnectionToCrs'][type='radio'][value='Yes']"));
                uiMarketerConnectionToCrs.Click();

                // enter the details
                NgWebElement uiMarketerConnectionToCrsDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='marketerConnectionToCrsDetails']"));
                uiMarketerConnectionToCrsDetails.SendKeys(marketerConnectionToCrsDetails);

                // !society !indigenousnation
                if ((bizType == "a private corporation") || (bizType == "a partnership"))
                {
                    // select 'Yes'
                    // Does a B.C. non-medical cannabis retail store licensee or applicant of cannabis have any association, connection or financial interest in the corporation?
                    NgWebElement uiCrsConnectionToMarketer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='crsConnectionToMarketer'][type='radio'][value='Yes']"));
                    uiCrsConnectionToMarketer.Click();

                    // enter the details
                    NgWebElement uiCrsConnectionToMarketerDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='crsConnectionToMarketerDetails']"));
                    uiCrsConnectionToMarketerDetails.SendKeys(crsConnectionToMarketer);
                }

                if (bizType == "a public corporation")
                {
                    // select 'Yes'
                    // Does any shareholder with 20% or more voting shares have any association, connection or financial interest in a B.C. non-medical cannabis retail store licensee or applicant of cannabis?
                    NgWebElement uiCrsConnectionToMarketer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='crsConnectionToMarketer'][type='radio'][value='Yes']"));
                    uiCrsConnectionToMarketer.Click();

                    // enter the details
                    NgWebElement uiCrsConnectionToMarketerDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='crsConnectionToMarketerDetails']"));
                    uiCrsConnectionToMarketerDetails.SendKeys(crsConnectionToMarketer);
                }

                if (bizType == "a sole proprietorship")
                {
                    // select 'Yes'
                    // Does the sole proprietor have an immediate family member that has any interest in a licensee or applicant?
                    NgWebElement uiCrsConnectionToMarketer = ngDriver.FindElement(By.CssSelector("input[formcontrolname='crsConnectionToMarketer'][type='radio'][value='Yes']"));
                    uiCrsConnectionToMarketer.Click();

                    // enter the details
                    NgWebElement uiCrsConnectionToMarketerDetails = ngDriver.FindElement(By.CssSelector("textarea[formcontrolname='crsConnectionToMarketerDetails']"));
                    uiCrsConnectionToMarketerDetails.SendKeys(crsConnectionToMarketer);
                }
            }

            // upload the Associates form
            FileUpload("associates.pdf", "(//input[@type='file'])[3]");

            // upload the Notice of Articles
            FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[5]");

            // upload the Central Securities Register
            FileUpload("central_securities_register.pdf", "(//input[@type='file'])[5]");

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

            uiContactPersonRole.SendKeys(contactTitle);

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

            uiContactPersonPhone.SendKeys(contactPhone);

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

            uiContactPersonEmail.SendKeys(contactEmail);

            // select authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("input[formcontrolname='authorizedToSubmit']"));

            uiAuthorizedToSubmit.Click();

            // select signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("input[formcontrolname='signatureAgreement']"));

            uiSignatureAgreement.Click();
        }
示例#18
0
 public LoginPage TypePassword(string password)
 {
     passwordField.SendKeys(password);
     return(this);
 }
示例#19
0
        public void RequestStoreRelocation(string applicationType)
        {
            /*
             * Page Title: Licences & Authorizations
             */

            string requestRelocationLink = "Request Relocation";

            // click on the request location link
            NgWebElement uiRequestRelocation = ngDriver.FindElement(By.LinkText(requestRelocationLink));

            uiRequestRelocation.Click();

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

            ContinueToApplicationButton();

            /*
             * Page Title: Submit a Licence Relocation Application
             */

            if (applicationType == "Cannabis")
            {
                string proposedAddress    = "Automated Test Street";
                string proposedCity       = "Victoria";
                string proposedPostalCode = "V9A 6X5";
                string pid = "012345678";

                // enter the proposed street address
                NgWebElement uiProposedAddress = ngDriver.FindElement(By.CssSelector(".ngtest-new-address input[formcontrolname='establishmentAddressStreet']"));
                uiProposedAddress.SendKeys(proposedAddress);

                // enter the proposed city
                NgWebElement uiProposedCity = ngDriver.FindElement(By.CssSelector(".ngtest-new-address input[formcontrolname='establishmentAddressCity']"));
                uiProposedCity.SendKeys(proposedCity);

                // enter the postal code
                NgWebElement uiProposedPostalCode = ngDriver.FindElement(By.CssSelector(".ngtest-new-address input[formcontrolname='establishmentAddressPostalCode']"));
                uiProposedPostalCode.SendKeys(proposedPostalCode);

                // enter the PID
                NgWebElement uiProposedPID = ngDriver.FindElement(By.Id("establishmentParcelId"));
                uiProposedPID.SendKeys(pid);
            }

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

            // select the authorized to submit checkbox
            NgWebElement uiAuthToSubmit = ngDriver.FindElement(By.Id("authorizedToSubmit"));

            uiAuthToSubmit.Click();

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

            uiSigAgreement.Click();

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

            // pay for the relocation application
            MakePayment();

            if (applicationType == "Cannabis")
            {
                /*
                 * Page Title: Payment Approved
                 */

                // confirm correct payment amount
                //Assert.True(ngDriver.FindElement(By.XPath("//body[contains(.,'$220.00')]")).Displayed);

                // return to the Licences tab
                ClickLicencesTab();
            }
        }
示例#20
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();
        }
        public void RequestEventAuthorization(string eventType)
        {
            /*
             * Page Title: Licences & Authorizations
             * Subtitle:   Catering Licences
             */

            /*
             * Temporary workaround for LCSD-3867 - start
             */

            // sign out
            SignOut();

            // log back in as same user
            ReturnLogin();

            // navigate to Licences tab
            ClickLicencesTab();

            /*
             * Temporary workaround for LCSD-3867 - end
             */

            string requestEventAuthorization = "Request Event Authorization";

            // click on the request event authorization link
            NgWebElement uiRequestEventAuthorization = ngDriver.FindElement(By.LinkText(requestEventAuthorization));

            uiRequestEventAuthorization.Click();

            /*
             * Page Title: Catered Event Authorization Request
             */

            // create event authorization data
            string eventContactName  = "AutoTestEventContactName";
            string eventContactPhone = "2500000000";

            string eventDescription               = "Automated test event description added here.";
            string eventClientOrHostName          = "Automated test event";
            string maximumAttendance              = "100";
            string maximumStaffAttendance         = "25";
            string maximumAttendanceApproval      = "300";
            string maximumStaffAttendanceApproval = "300";

            string venueNameDescription      = "Automated test venue name or description";
            string venueAdditionalInfo       = "Automated test additional venue information added here.";
            string physicalAddStreetAddress1 = "Automated test street address 1";
            string physicalAddStreetAddress2 = "Automated test street address 2";
            string physicalAddCity           = "Victoria";
            string physicalAddPostalCode     = "V9A 6X5";

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

            uiEventContactName.SendKeys(eventContactName);

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

            uiEventContactPhone.SendKeys(eventContactPhone);

            if (eventType == "for a community event after 2am")
            {
                // select community event type
                NgWebElement uiEventType = ngDriver.FindElement(By.CssSelector("[formcontrolname='eventType'] [value='1: 845280001']"));
                uiEventType.Click();
            }
            else
            {
                // select corporate event type
                NgWebElement uiEventType = ngDriver.FindElement(By.CssSelector("[formcontrolname='eventType'] option[value='2: 845280002']"));
                uiEventType.Click();
            }

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

            uiEventDescription.SendKeys(eventDescription);

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

            uiEventClientOrHostName.SendKeys(eventClientOrHostName);

            if (eventType == "with more than 500 people")
            {
                // enter maximum attendance
                NgWebElement uiMaxAttendance = ngDriver.FindElement(By.CssSelector("input[formcontrolname='maxAttendance']"));
                uiMaxAttendance.SendKeys(maximumAttendanceApproval);

                // enter maximum staff attendance
                NgWebElement uiMaxStaffAttendance = ngDriver.FindElement(By.CssSelector("input[formcontrolname='maxStaffAttendance']"));
                uiMaxStaffAttendance.SendKeys(maximumStaffAttendanceApproval);
            }
            else
            {
                // enter maximum attendance
                NgWebElement uiMaxAttendance = ngDriver.FindElement(By.CssSelector("input[formcontrolname='maxAttendance']"));
                uiMaxAttendance.SendKeys(maximumAttendance);

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

            // select whether minors are attending - yes
            NgWebElement uiMinorsAttending = ngDriver.FindElement(By.CssSelector("[formcontrolname='minorsAttending'] option[value='true']"));

            uiMinorsAttending.Click();

            // select type of food service provided
            NgWebElement uiFoodServiceProvided = ngDriver.FindElement(By.CssSelector("[formcontrolname='foodService'] option[value='0: 845280000']"));

            uiFoodServiceProvided.Click();

            // select type of entertainment provided
            NgWebElement uiEntertainmentProvided = ngDriver.FindElement(By.CssSelector("[formcontrolname='entertainment'] option[value='1: 845280001']"));

            uiEntertainmentProvided.Click();

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

            uiVenueNameDescription.SendKeys(venueNameDescription);

            if (eventType == "for an outdoor location")
            {
                // select outdoor venue location
                NgWebElement uiVenueLocation = ngDriver.FindElement(By.CssSelector("[formcontrolname='specificLocation'] option[value='1: 845280001']"));
                uiVenueLocation.Click();
            }
            else if (eventType == "for an indoor and outdoor location")
            {
                // select both indoor/outdoor venue location
                NgWebElement uiVenueLocation = ngDriver.FindElement(By.CssSelector("[formcontrolname='specificLocation'] option[value='2: 845280002']"));
                uiVenueLocation.Click();
            }
            else
            {
                // select indoor venue location
                NgWebElement uiVenueLocation = ngDriver.FindElement(By.CssSelector("[formcontrolname='specificLocation'] option[value='0: 845280000']"));
                uiVenueLocation.Click();
            }

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

            uiVenueAdditionalInfo.SendKeys(venueAdditionalInfo);

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

            uiPhysicalAddStreetAddress1.SendKeys(physicalAddStreetAddress1);

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

            uiPhysicalAddStreetAddress2.SendKeys(physicalAddStreetAddress2);

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

            uiPhysicalAddCity.SendKeys(physicalAddCity);

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

            uiPhysicalAddPostalCode.SendKeys(physicalAddPostalCode);

            // select start date
            NgWebElement uiVenueStartDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='startDate']"));

            uiVenueStartDate1.Click();

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

            uiVenueStartDate2.Click();

            // select end date
            NgWebElement uiEndDate1 = ngDriver.FindElement(By.CssSelector("input[formcontrolname='endDate']"));

            uiEndDate1.Click();

            // click on the next button
            NgWebElement uiOpenCalendarNext = ngDriver.FindElement(By.CssSelector(".mat-calendar .mat-calendar-next-button"));

            uiOpenCalendarNext.Click();

            // click on the first day
            NgWebElement uiOpenCalendarFirstDay = ngDriver.FindElement(By.CssSelector(".mat-calendar-content .mat-calendar-body-cell-content:first-child"));

            JavaScriptClick(uiOpenCalendarFirstDay);

            // select event and liquor end time after 2am
            if ((eventType == "for after 2am") || (eventType == "for a community event after 2am"))
            {
                NgWebElement uiEventCloseTime = ngDriver.FindElement(By.CssSelector(".col-md-2:nth-child(3) .ngb-tp-minute .ng-star-inserted:nth-child(1) .ngb-tp-chevron"));
                JavaScriptClick(uiEventCloseTime);

                NgWebElement uiLiquorCloseTime = ngDriver.FindElement(By.CssSelector(".col-md-2:nth-child(5) .ngb-tp-minute .btn-link:nth-child(1) .ngb-tp-chevron"));
                JavaScriptClick(uiLiquorCloseTime);
            }

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

            uiTermsAndConditions.Click();

            if ((eventType == "for a draft") || (eventType == "being validated"))
            {
                // click on the Save For Later button
                NgWebElement uiSaveForLater = ngDriver.FindElement(By.CssSelector(".btn-primary:nth-child(1)"));
                uiSaveForLater.Click();
            }
            else
            {
                // click on the Submit button
                NgWebElement uiSubmit = ngDriver.FindElement(By.CssSelector(".btn-primary~ .btn-primary+ .btn-primary"));
                uiSubmit.Click();
            }
        }
示例#22
0
        public void NewOutdoorPatioApplication()
        {
            /*
             * Page Title: Please Review Your Account Profile
             */

            // click on Continue to Application button
            ContinueToApplicationButton();

            /*
             * Page Title: New Outdoor Patio
             */

            // create test data
            string patioCompDescription          = "Sample patio composition description.";
            string patioLocationDescription      = "Sample patio location description.";
            string patioAccessDescription        = "Sample patio access description.";
            string patioLiquorCarriedDescription = "Sample liquor carried description.";
            string patioAccessControlDescription = "Sample patio access control description.";
            string areaDescription = "Sample area description";
            string occupantLoad    = "180";

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

            uiPatioCompDescription.SendKeys(patioCompDescription);

            // enter patio location description
            NgWebElement uiPatioLocationDescription = ngDriver.FindElement(By.CssSelector("textarea#patioLocationDescription"));

            uiPatioLocationDescription.SendKeys(patioLocationDescription);

            // enter patio access description
            NgWebElement uiPatioAccessDescription = ngDriver.FindElement(By.CssSelector("textarea#patioAccessDescription"));

            uiPatioAccessDescription.SendKeys(patioAccessDescription);

            // click on Is Liquor Carried checkbox
            NgWebElement uiPatioIsLiquorCarried = ngDriver.FindElement(By.CssSelector("mat-checkbox#patioIsLiquorCarried"));

            JavaScriptClick(uiPatioIsLiquorCarried);

            // enter Is Liquor Carried description
            NgWebElement uiPatioLiquorCarriedDescription = ngDriver.FindElement(By.CssSelector("textarea#patioLiquorCarriedDescription"));

            uiPatioLiquorCarriedDescription.SendKeys(patioLiquorCarriedDescription);

            // enter patio access control description
            NgWebElement uiPatioAccessControlDescription = ngDriver.FindElement(By.CssSelector("textarea#patioAccessControlDescription"));

            uiPatioAccessControlDescription.SendKeys(patioAccessControlDescription);

            // click Fixed option
            NgWebElement uiFixedOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-25-button"));

            uiFixedOption.Click();

            // click Portable option
            NgWebElement uiPortableOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-26-button"));

            uiPortableOption.Click();

            // click Interior option
            NgWebElement uiInteriorOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-27-button"));

            uiInteriorOption.Click();

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

            // click on service area button
            NgWebElement uiServiceAreas = ngDriver.FindElement(By.CssSelector("[formcontrolname= 'serviceAreas'] button"));

            uiServiceAreas.Click();

            // enter area description
            NgWebElement uiAreaDescription = ngDriver.FindElement(By.CssSelector("input[formcontrolname='areaLocation']"));

            uiAreaDescription.SendKeys(areaDescription);

            // enter occupant load
            NgWebElement uiOccupantLoad = ngDriver.FindElement(By.CssSelector("input[formcontrolname='capacity']"));

            uiOccupantLoad.SendKeys(occupantLoad);

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

            // click on the isOwnerBusiness checkbox
            NgWebElement uiIsOwnerBusiness = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isOwnerBusiness']"));

            uiIsOwnerBusiness.Click();

            // click on the hasValidInterest checkbox
            NgWebElement uiHasValidInterest = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='hasValidInterest']"));

            uiHasValidInterest.Click();

            // click on the willHaveValidInterest checkbox
            NgWebElement uiWillHaveValidInterest = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='willHaveValidInterest']"));

            uiWillHaveValidInterest.Click();

            // click on the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='authorizedToSubmit']"));

            uiAuthorizedToSubmit.Click();

            // click on the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSignatureAgreement.Click();
        }
示例#23
0
        public void LPRelocationApplication()
        {
            /*
             * Page Title: Please Review the Account Profile
             */

            ContinueToApplicationButton();

            /*
             * Page Title: Liquor Primary and Liquor Primary Club Relocation Application
             */

            // create test data
            string patioPerimeter     = "Sample patio perimeter";
            string patioLocation      = "Sample patio location";
            string patioAccess        = "Sample patio access";
            string liquorCarried      = "Sample liquor carried details";
            string patioAccessControl = "Sample patio access control";
            string establishmentType  = "Military mess";

            // click zoning checkbox
            NgWebElement uiIsPermittedInZoning = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isPermittedInZoning']"));

            uiIsPermittedInZoning.Click();

            // select 'yes' for Treaty First Nation Land
            NgWebElement uiIsTreatyFirstNationLand = ngDriver.FindElement(By.CssSelector("[formcontrolname='isOnINLand'] mat-radio-button#mat-radio-5"));

            uiIsTreatyFirstNationLand.Click();

            // upload a letter of intent
            FileUpload("letter_of_intent.pdf", "(//input[@type='file'])[2]");

            // select 'yes' for patio
            NgWebElement uiHasPatioYes = ngDriver.FindElement(By.CssSelector("[formcontrolname='isHasPatio'] mat-radio-button#mat-radio-2"));

            uiHasPatioYes.Click();

            // enter patio perimeter details
            NgWebElement uiPatioComp = ngDriver.FindElement(By.CssSelector("textarea#patioCompDescription"));

            uiPatioComp.SendKeys(patioPerimeter);

            // enter patio location details
            NgWebElement uiPatioLocation = ngDriver.FindElement(By.CssSelector("textarea#patioLocationDescription"));

            uiPatioLocation.SendKeys(patioLocation);

            // enter patio access details
            NgWebElement uiPatioAccess = ngDriver.FindElement(By.CssSelector("textarea#patioAccessDescription"));

            uiPatioAccess.SendKeys(patioAccess);

            // check liquor carried checkbox
            NgWebElement uiPatioLiquorCarried = ngDriver.FindElement(By.CssSelector("mat-checkbox#patioIsLiquorCarried"));

            uiPatioLiquorCarried.Click();

            // enter liquor carried details
            NgWebElement uiLiquorCarriedDetails = ngDriver.FindElement(By.CssSelector("textarea#patioLiquorCarriedDescription"));

            uiLiquorCarriedDetails.SendKeys(liquorCarried);

            // enter patio access control description
            NgWebElement uiPatioAccessControl = ngDriver.FindElement(By.CssSelector("textarea#patioAccessControlDescription"));

            uiPatioAccessControl.SendKeys(patioAccessControl);

            // click Fixed option
            NgWebElement uiFixedOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-1-button"));

            uiFixedOption.Click();

            // click Portable option
            NgWebElement uiPortableOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-2-button"));

            uiPortableOption.Click();

            // click Interior option
            NgWebElement uiInteriorOption = ngDriver.FindElement(By.CssSelector("#mat-button-toggle-3-button"));

            uiInteriorOption.Click();

            // enter the establishment type
            NgWebElement uiEstablishmentType = ngDriver.FindElement(By.CssSelector("input[formcontrolname='description1']"));

            uiEstablishmentType.SendKeys(establishmentType);

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

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

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

            /*
             * // click on service area button
             * NgWebElement uiServiceAreas = ngDriver.FindElement(By.CssSelector("[formcontrolname= 'serviceAreas'] button"));
             * uiServiceAreas.Click();
             *
             * // enter area description
             * NgWebElement uiAreaDescription = ngDriver.FindElement(By.CssSelector("input[formcontrolname='areaLocation']"));
             * uiAreaDescription.SendKeys(areaDescription);
             *
             * // enter occupant load
             * NgWebElement uiOccupantLoad = ngDriver.FindElement(By.CssSelector("input[formcontrolname='capacity']"));
             * uiOccupantLoad.SendKeys(occupantLoad);
             */

            // enter the hours of sales
            NgWebElement uiServiceHoursSundayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursSundayOpen'] option[value='09:00']"));

            uiServiceHoursSundayOpen.Click();

            NgWebElement uiServiceHoursSundayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursSundayClose'] option[value='21:00']"));

            uiServiceHoursSundayClose.Click();

            NgWebElement uiServiceHoursMondayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursMondayOpen'] option[value='11:00']"));

            uiServiceHoursMondayOpen.Click();

            NgWebElement uiServiceHoursMondayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursMondayClose'] option[value='23:00']"));

            uiServiceHoursMondayClose.Click();

            NgWebElement uiServiceHoursTuesdayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursTuesdayOpen'] option[value='09:15']"));

            uiServiceHoursTuesdayOpen.Click();

            NgWebElement uiServiceHoursTuesdayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursTuesdayClose'] option[value='10:30']"));

            uiServiceHoursTuesdayClose.Click();

            NgWebElement uiServiceHoursWednesdayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursWednesdayOpen'] option[value='12:30']"));

            uiServiceHoursWednesdayOpen.Click();

            NgWebElement uiServiceHoursWednesdayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursWednesdayClose'] option[value='21:30']"));

            uiServiceHoursWednesdayClose.Click();

            NgWebElement uiServiceHoursThursdayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursThursdayOpen'] option[value='14:30']"));

            uiServiceHoursThursdayOpen.Click();

            NgWebElement uiServiceHoursThursdayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursThursdayClose'] option[value='19:00']"));

            uiServiceHoursThursdayClose.Click();

            NgWebElement uiServiceHoursFridayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursFridayOpen'] option[value='17:00']"));

            uiServiceHoursFridayOpen.Click();

            NgWebElement uiServiceHoursFridayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursFridayClose'] option[value='19:45']"));

            uiServiceHoursFridayClose.Click();

            NgWebElement uiServiceHoursSaturdayOpen = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursSaturdayOpen'] option[value='09:45']"));

            uiServiceHoursSaturdayOpen.Click();

            NgWebElement uiServiceHoursSaturdayClose = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceHoursSaturdayClose'] option[value='20:00']"));

            uiServiceHoursSaturdayClose.Click();

            // select the owner checkbox
            NgWebElement uiOwner = ngDriver.FindElement(By.CssSelector(".mat-checkbox[formcontrolname='isOwnerBusiness']"));

            uiOwner.Click();

            // select the valid interest checkbox
            NgWebElement uiValidInterest = ngDriver.FindElement(By.CssSelector(".mat-checkbox[formcontrolname='hasValidInterest']"));

            uiValidInterest.Click();

            // select the future valid interest checkbox
            NgWebElement uiFutureValidInterest = ngDriver.FindElement(By.CssSelector(".mat-checkbox[formcontrolname='willHaveValidInterest']"));

            uiFutureValidInterest.Click();

            // select the authorized to submit checkbox
            NgWebElement uiAuthToSubmit = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='authorizedToSubmit']"));

            uiAuthToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSigAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSigAgreement.Click();
        }
        public void SpecialEventAreaEndorsement()
        {
            /*
             * Page Title: Licences & Authorizations
             */

            string specialEventAreaEndorsement = "Special Event Area Endorsement Application";

            // click on the Special Event Area Endorsement Application link
            NgWebElement uiSpecialEventAreaEndorsement = ngDriver.FindElement(By.LinkText(specialEventAreaEndorsement));

            uiSpecialEventAreaEndorsement.Click();

            ContinueToApplicationButton();

            /*
             * Page Title: Special Event Area Endorsement Application
             */

            // creeate test data
            string serviceAreaDescription  = "Service area description";
            string serviceAreaOccupantLoad = "100";
            string outdoorAreaDescription  = "Outdoor area description";
            string outdoorAreaCapacity     = "150";
            string contactTitle            = "Tester";

            // select the zoning checkbox
            NgWebElement uiZoningCheckbox = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isPermittedInZoning']"));

            uiZoningCheckbox.Click();

            // upload the letter of intent
            FileUpload("letter_of_intent.pdf", "(//input[@type='file'])[2]");

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

            // add a service area
            NgWebElement uiServiceArea = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceAreas'] button"));

            ScrollToElement(uiServiceArea);
            uiServiceArea.Click();

            // enter the service area description
            NgWebElement uiServiceAreaDescription = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceAreas'] input[formcontrolname='areaLocation']"));

            uiServiceAreaDescription.SendKeys(serviceAreaDescription);

            // enter the service area occupant load
            NgWebElement uiServiceAreaOccupantLoad = ngDriver.FindElement(By.CssSelector("[formcontrolname='serviceAreas'] input[formcontrolname='capacity']"));

            uiServiceAreaOccupantLoad.SendKeys(serviceAreaOccupantLoad);

            // add outside area
            NgWebElement uiOutdoorArea = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] button"));

            uiOutdoorArea.Click();

            // enter the outdooor area description
            NgWebElement uiOutdoorAreaDescription = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] input[formcontrolname='areaLocation']"));

            uiOutdoorAreaDescription.SendKeys(outdoorAreaDescription);

            // enter the outdoor area occupant load
            NgWebElement uiOutdoorAreaOccupantLoad = ngDriver.FindElement(By.CssSelector("[formcontrolname='outsideAreas'] input[formcontrolname='capacity']"));

            uiOutdoorAreaOccupantLoad.SendKeys(outdoorAreaCapacity);

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

            // select the Sunday opening time
            NgWebElement uiSundayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSundayOpen'] option[value='10:00']"));

            uiSundayOpen.Click();

            // select the Sunday closing time
            NgWebElement uiSundayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSundayClose'] option[value='16:00']"));

            uiSundayClose.Click();

            // select the Monday opening time
            NgWebElement uiMondayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursMondayOpen'] option[value='09:00']"));

            uiMondayOpen.Click();

            // select the Monday closing time
            NgWebElement uiMondayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursMondayClose'] option[value='23:00']"));

            uiMondayClose.Click();

            // select the Tuesday opening time
            NgWebElement uiTuesdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursTuesdayOpen'] option[value='09:15']"));

            uiTuesdayOpen.Click();

            // select the Tuesday closing time
            NgWebElement uiTuesdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursTuesdayClose'] option[value='22:45']"));

            uiTuesdayClose.Click();

            // select the Wednesday opening time
            NgWebElement uiWednesdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursWednesdayOpen'] option[value='09:30']"));

            uiWednesdayOpen.Click();

            // select the Wednesday closing time
            NgWebElement uiWednesdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursWednesdayClose'] option[value='12:00']"));

            uiWednesdayClose.Click();

            // select the Thursday opening time
            NgWebElement uiThursdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursThursdayOpen'] option[value='13:00']"));

            uiThursdayOpen.Click();

            // select the Thursday closing time
            NgWebElement uiThursdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursThursdayClose'] option[value='14:00']"));

            uiThursdayClose.Click();

            // select the Friday opening time
            NgWebElement uiFridayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursFridayOpen'] option[value='12:15']"));

            uiFridayOpen.Click();

            // select the Friday closing time
            NgWebElement uiFridayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursFridayClose'] option[value='21:15']"));

            uiFridayClose.Click();

            // select the Saturday opening time
            NgWebElement uiSaturdayOpen = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSaturdayOpen'] option[value='10:00']"));

            uiSaturdayOpen.Click();

            // select the Saturday closing time
            NgWebElement uiSaturdayClose = ngDriver.FindElement(By.CssSelector("select[formcontrolname='serviceHoursSaturdayClose'] option[value='22:00']"));

            uiSaturdayClose.Click();

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

            uiContactTitle.SendKeys(contactTitle);

            // select the authorized to submit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='authorizedToSubmit']"));

            uiAuthorizedToSubmit.Click();

            // select the signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSignatureAgreement.Click();

            // click on the Submit & Pay button
            ClickOnSubmitButton();
        }
        public void SpecifyContactDetails(string applicationType)
        {
            /*
             * Page Title: Provide Confirmation of Zoning
             */

            // create test data
            string nameOfOfficial = "Official Name";
            string title          = "Title";
            string phone          = "1811811818";
            string email          = "*****@*****.**";

            // enter the name of the official
            NgWebElement uiOfficialName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lGNameOfOfficial']"));

            uiOfficialName.SendKeys(nameOfOfficial);

            // enter the official's title
            NgWebElement uiOfficialTitle = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lGTitlePosition']"));

            uiOfficialTitle.SendKeys(title);

            // enter the official's phone number
            NgWebElement uiOfficialPhone = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lGContactPhone']"));

            uiOfficialPhone.SendKeys(phone);

            // enter the official's email
            NgWebElement uiOfficialEmail = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lGContactEmail']"));

            uiOfficialEmail.SendKeys(email);

            // upload the supporting reports
            if ((applicationType == "liquor primary") || (applicationType == "relocation"))
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[14]");

                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[17]");
            }
            else if ((applicationType == "live theatre") || (applicationType == "T&C Change"))
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[5]");
            }
            else if (applicationType == "outdoor patio")
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[8]");

                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[11]");
            }
            else if (applicationType == "structural change")
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[5]");

                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[8]");
            }
            else if (applicationType == "TUA")
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[11]");
            }
            else
            {
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[11]");
            }
        }
示例#26
0
        public void CompleteStep1OfApplication()
        {
            /*
             * Page Title: Worker Security Verification Application - Step 1
             */

            //string previousFirst = "First";
            //string previousMiddle = "Middle";
            //string previousLast = "Last";
            string birthCityCountry = "Victoria, Canada";
            string BCDL             = "1234568";
            string BCID             = "123456789";
            string primaryPhone     = "2508888888";
            string email            = "*****@*****.**";
            string mailingStreet    = "645 Tyee Road";
            string mailingCity      = "Victoria";
            string mailingProvince  = "BC";
            string postalCode       = "V8V4Y3";

            /* - under development
             * // click on link to add previous name
             * NgWebElement uiPreviousNameLink = ngDriver.FindElement(By.CssSelector("div:nth-child(3) span a"));
             * uiPreviousNameLink.Click();
             *
             * // enter the previous first name
             * NgWebElement uiPreviousFirstName = ngDriver.FindElement(By.CssSelector("section:nth-child(2) input"));
             * uiPreviousFirstName.Click();
             * //uiPreviousFirstName.SendKeys(previousFirst);
             *
             * // enter the previous middle name
             * NgWebElement uiPreviousMiddleName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='middlename']"));
             * uiPreviousMiddleName.Click();
             * //uiPreviousMiddleName.SendKeys(previousMiddle);
             *
             * // enter the previous last name
             * NgWebElement uiPreviousLastName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='lastname']"));
             * uiPreviousLastName.Click();
             * //uiPreviousLastName.SendKeys(previousLast);
             */

            // enter the birth city and country
            NgWebElement uiBirthCityCountry = ngDriver.FindElement(By.CssSelector("input[formcontrolname='birthPlace']"));

            uiBirthCityCountry.SendKeys(birthCityCountry);

            // enter the BC driver's licence
            NgWebElement uiBCDL = ngDriver.FindElement(By.CssSelector("input[formcontrolname='primaryIdNumber']"));

            uiBCDL.SendKeys(BCDL);

            // enter the BCID
            NgWebElement uiBCID = ngDriver.FindElement(By.CssSelector("input[formcontrolname='secondaryIdNumber']"));

            uiBCID.SendKeys(BCID);

            // enter the primary phone number
            NgWebElement uiPrimaryPhone = ngDriver.FindElement(By.CssSelector("input[formcontrolname='mobilePhone']"));

            uiPrimaryPhone.SendKeys(primaryPhone);

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

            uiEmail.SendKeys(email);

            // select the start date textbox (Date: From) for the current address
            NgWebElement openCalendar = ngDriver.FindElement(By.CssSelector("input[formcontrolname='fromdate']"));

            openCalendar.Click();

            // select the calendar period button
            NgWebElement nextCalendar = ngDriver.FindElement(By.XPath("//mat-calendar[@id='mat-datepicker-0']/mat-calendar-header/div/div/button/span"));

            nextCalendar.Click();

            // select the year
            NgWebElement nextCalendar2 = ngDriver.FindElement(By.XPath("//mat-calendar[@id='mat-datepicker-0']/div/mat-multi-year-view/table/tbody/tr[3]/td[2]/div"));

            nextCalendar2.Click();

            // select the month
            NgWebElement nextCalendar3 = ngDriver.FindElement(By.XPath("//mat-calendar[@id='mat-datepicker-0']/div/mat-year-view/table/tbody/tr[3]/td[3]/div"));

            nextCalendar3.Click();

            // select the day
            NgWebElement nextCalendar4 = ngDriver.FindElement(By.XPath("//mat-calendar[@id='mat-datepicker-0']/div/mat-month-view/table/tbody/tr[4]/td[3]/div"));

            nextCalendar4.Click();

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

            uiMailingStreet.SendKeys(mailingStreet);

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

            uiMailingCity.SendKeys(mailingCity);

            // enter the province of the mailing address
            NgWebElement uiMailingProvince = ngDriver.FindElement(By.CssSelector("input[formcontrolname='address2_stateorprovince']"));

            uiMailingProvince.SendKeys(mailingProvince);

            // enter the postal code of the mailing address
            NgWebElement uiPostalCode = ngDriver.FindElement(By.CssSelector("input[formcontrolname='address2_postalcode']"));

            uiPostalCode.SendKeys(postalCode);

            // click on save and continue button
            NgWebElement saveAndContinueButton = ngDriver.FindElement(By.CssSelector("span button.btn-primary.btn"));

            saveAndContinueButton.Click();
        }
        public void UBrewUVinApplication(string businessType)
        {
            string establishmentName = "Point Ellis Greenhouse";
            string streetAddress     = "645 Tyee Road";
            string city         = "Victoria";
            string postalCode   = "V9A6X5";
            string PID          = "999999999";
            string storeEmail   = "*****@*****.**";
            string storePhone   = "2222222222";
            string contactTitle = "Brewmaster";
            string contactPhone = "3333333333";
            string contactEmail = "*****@*****.**";

            if (businessType != " sole proprietorship")
            {
                // upload a central securities register
                FileUpload("central_securities_register.pdf", "(//input[@type='file'])[3]");

                // upload supporting business documentation
                FileUpload("associates.pdf", "(//input[@type='file'])[6]");

                // upload notice of articles
                FileUpload("notice_of_articles.pdf", "(//input[@type='file'])[9]");
            }

            // upload personal history summary form
            if (businessType == " sole proprietorship")
            {
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[3]");
            }
            else
            {
                FileUpload("personal_history_summary.pdf", "(//input[@type='file'])[12]");
            }

            // upload shareholders < 10% interest
            if (businessType != " sole proprietorship")
            {
                FileUpload("shareholders_less_10_interest.pdf", "(//input[@type='file'])[15]");
            }

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

            uiEstablishmentName.SendKeys(establishmentName);

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

            uiEstablishmentAddressStreet.SendKeys(streetAddress);

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

            uiEstablishmentAddressCity.SendKeys(city);

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

            uiEstablishmentAddressPostalCode.SendKeys(postalCode);

            // enter the PID
            NgWebElement uiEstablishmentParcelId = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentParcelId']"));

            uiEstablishmentParcelId.SendKeys(PID);

            // enter the store email
            NgWebElement uiEstablishmentEmail = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentEmail']"));

            uiEstablishmentEmail.SendKeys(storeEmail);

            // enter the store phone
            NgWebElement uiEstablishmentPhone = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentPhone']"));

            uiEstablishmentPhone.SendKeys(storePhone);

            if (businessType == " sole proprietorship")
            {
                // upload the signage document
                FileUpload("signage.pdf", "(//input[@type='file'])[5]");
            }
            else
            {
                // upload the signage document
                FileUpload("signage.pdf", "(//input[@type='file'])[17]");
            }

            // select owner business checkbox
            NgWebElement uiIsOwnerBusiness = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='isOwnerBusiness']"));

            uiIsOwnerBusiness.Click();

            // select has valid interest checkbox
            NgWebElement uiHasValidInterest = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='hasValidInterest']"));

            uiHasValidInterest.Click();

            // select will have valid interest checkbox
            NgWebElement uiWillhaveValidInterest = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='willHaveValidInterest']"));

            uiWillhaveValidInterest.Click();

            if (businessType == " sole proprietorship")
            {
                // upload the valid interest document
                FileUpload("valid_interest.pdf", "(//input[@type='file'])[9]");
            }
            else
            {
                // upload the valid interest document
                FileUpload("valid_interest.pdf", "(//input[@type='file'])[21]");
            }

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

            uiContactPersonRole.SendKeys(contactTitle);

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

            uiContactPersonPhone.SendKeys(contactPhone);

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

            uiContactPersonEmail.SendKeys(contactEmail);

            // click on authorize signature checkbox
            NgWebElement uiAuthorizeSignature = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='authorizedToSubmit']"));

            uiAuthorizeSignature.Click();

            // click on signature agreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.CssSelector("mat-checkbox[formcontrolname='signatureAgreement']"));

            uiSignatureAgreement.Click();

            // retrieve the current URL to get the application ID (needed downstream)
            string URL = ngDriver.Url;

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

            applicationID = parsedURL[5];
        }
        public void CompleteCateringApplication()
        {
            /*
             * Page Title: Catering Licence Application
             */

            // create application info
            string prevAppDetails       = "Here are the previous application details (automated test).";
            string liqConnectionDetails = "Here are the liquor industry connection details (automated test).";
            string estName    = "Point Ellis Greenhouse";
            string estAddress = "645 Tyee Rd";
            string estCity    = "Victoria";
            string estPostal  = "V9A 6X5";
            string estPID     = "012345678";
            string estPhone   = "2505555555";
            string estEmail   = "*****@*****.**";
            string conGiven   = "Given";
            string conSurname = "Surname";
            string conRole    = "CEO";
            string conPhone   = "2508888888";
            string conEmail   = "*****@*****.**";

            // enter the establishment name
            try
            {
                NgWebElement uiEstabName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentName']"));
                uiEstabName.SendKeys(estName);
            }
            catch (Exception)
            {
                //System.Threading.Thread.Sleep(1000);

                NgWebElement uiEstabName = ngDriver.FindElement(By.CssSelector("input[formcontrolname='establishmentName']"));
                uiEstabName.SendKeys(estName);
            }

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

            uiEstabAddress.SendKeys(estAddress);

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

            uiEstabCity.SendKeys(estCity);

            // enter the establishment postal code
            NgWebElement uiEstabPostal = ngDriver.FindElement(By.Id("establishmentAddressPostalCode"));

            uiEstabPostal.SendKeys(estPostal);

            // enter the PID
            NgWebElement uiEstabPID = ngDriver.FindElement(By.Id("establishmentParcelId"));

            uiEstabPID.SendKeys(estPID);

            // enter the store email
            NgWebElement uiEstabEmail = ngDriver.FindElement(By.Id("establishmentEmail"));

            uiEstabEmail.SendKeys(estEmail);

            // enter the store phone number
            NgWebElement uiEstabPhone = ngDriver.FindElement(By.Id("establishmentPhone"));

            uiEstabPhone.SendKeys(estPhone);

            // select 'Yes'
            // Do you or any of your shareholders currently hold, have held, or have previously applied for a British Columbia liquor licence?
            NgWebElement uiPreviousLicenceYes = ngDriver.FindElement(By.Id("mat-button-toggle-1-button"));

            uiPreviousLicenceYes.Click();

            // enter the previous application details
            NgWebElement uiPreviousApplicationDetails = ngDriver.FindElement(By.Id("previousApplicationDetails"));

            uiPreviousApplicationDetails.SendKeys(prevAppDetails);

            // select 'Yes'
            // Do you hold a Rural Agency Store Appointment?
            NgWebElement uiRuralAgencyStore = ngDriver.FindElement(By.Id("mat-button-toggle-4-button"));

            uiRuralAgencyStore.Click();

            // select 'Yes'
            // Do you, or any of your shareholders, have any connection, financial or otherwise, direct or indirect, with a distillery, brewery or winery?
            NgWebElement uiOtherBusinessYes = ngDriver.FindElement(By.Id("mat-button-toggle-7-button"));

            uiOtherBusinessYes.Click();

            // enter the connection details
            NgWebElement uiLiqIndConnection = ngDriver.FindElement(By.Id("liquorIndustryConnectionsDetails"));

            uiLiqIndConnection.SendKeys(liqConnectionDetails);

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

            // enter the first name of the application contact
            NgWebElement uiContactGiven = ngDriver.FindElement(By.Id("contactPersonFirstName"));

            uiContactGiven.SendKeys(conGiven);

            // enter the last name of the application contact
            NgWebElement uiContactSurname = ngDriver.FindElement(By.Id("contactPersonLastName"));

            uiContactSurname.SendKeys(conSurname);

            // enter the role of the application contact
            NgWebElement uiContactRole = ngDriver.FindElement(By.CssSelector("input[formcontrolname='contactPersonRole']"));

            uiContactRole.SendKeys(conRole);

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

            uiContactPhone.SendKeys(conPhone);

            // enter the email of the application contact
            NgWebElement uiContactEmail = ngDriver.FindElement(By.Id("contactPersonEmail"));

            uiContactEmail.SendKeys(conEmail);

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

            uiAuthorizedToSubmit.Click();

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

            uiSignatureAgreement.Click();

            // retrieve the current URL to get the application ID (needed downstream)
            string URL = ngDriver.Url;

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

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

            applicationID = tempFix[0];
        }
示例#29
0
 public void SetNewElement(NgWebElement element, string newValue)
 {
     element.Clear();
     element.SendKeys(newValue);
     ngDriver.WaitForAngular();
 }
示例#30
0
        public void FPStructuralChange()
        {
            /*
             * Page Title: Please Review the Account Profile
             */

            ContinueToApplicationButton();

            /*
             * Page Title: Food Primary Structural Change Application
             */

            // create test data
            string description1    = "Test automation outline of the proposed change.";
            string description2    = "Test automation patio location.";
            string areaDescription = "Test automation area description.";
            string occupantLoad    = "180";

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

            uiDescriptionOfChange.SendKeys(description1);

            // enter the location of the patio
            NgWebElement uiPatioLocation = ngDriver.FindElement(By.CssSelector("textarea#description2"));

            uiPatioLocation.SendKeys(description2);

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

            // click on service area button
            NgWebElement uiServiceAreas = ngDriver.FindElement(By.CssSelector("[formcontrolname= 'serviceAreas'] button"));

            uiServiceAreas.Click();

            // enter area description
            NgWebElement uiAreaDescription = ngDriver.FindElement(By.CssSelector("input[formcontrolname='areaLocation']"));

            uiAreaDescription.SendKeys(areaDescription);

            // enter occupant load
            NgWebElement uiOccupantLoad = ngDriver.FindElement(By.CssSelector("input[formcontrolname='capacity']"));

            uiOccupantLoad.SendKeys(occupantLoad);

            // select authorizedToSubmit checkbox
            NgWebElement uiAuthorizedToSubmit = ngDriver.FindElement(By.Id("authorizedToSubmit"));

            uiAuthorizedToSubmit.Click();

            // select signatureAgreement checkbox
            NgWebElement uiSignatureAgreement = ngDriver.FindElement(By.Id("signatureAgreement"));

            uiSignatureAgreement.Click();

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

            // pay for the structural change application
            MakePayment();

            /*
             * Page Title: Payment Approved
             */

            ClickLicencesTab();
        }