Exemple #1
0
        public SubmittedRoleForm Submit(string licensee, string brand, string code, string name, string permission)
        {
            var roleCode = _driver.FindElementWait(By.XPath("//input[contains(@data-bind, 'value: Model.code')]"));

            roleCode.SendKeys(code);
            var roleName =
                _driver.FindElementWait(By.XPath("//div[@id='add-role-home']//input[contains(@data-bind, 'value: Model.name')]"));

            roleName.SendKeys(name);

            var licenseesWidget = new MultiSelectWidget(_driver, By.XPath("//div[contains(@data-bind, 'items: Model.assignedLicensees')]"));

            licenseesWidget.SelectFromMultiSelect(licensee);

            _driver.ScrollPage(0, 900);
            var rolePermission =
                _driver.FindElementWait(By.XPath(permission));

            rolePermission.Click();
            _driver.ScrollPage(0, 1600);
            var submitButton = _driver.FindElementWait(By.XPath("//div[@id='add-role-home']//button[text()='Save']"));

            submitButton.Click();
            var submittedForm = new SubmittedRoleForm(_driver);

            return(submittedForm);
        }
Exemple #2
0
        public SubmittedRoleForm Submit()
        {
            _submitButton.Click();
            var form = new SubmittedRoleForm(_driver);

            form.Initialize();
            return(form);
        }
Exemple #3
0
        public SubmittedRoleForm FillInRequiredFields(RoleData data)
        {
            var roleCode = _driver.FindElementWait(By.XPath("//input[contains(@data-bind, 'value: Model.code')]"));

            roleCode.SendKeys(data.RoleCode);
            var roleName =
                _driver.FindElementWait(By.XPath("//div[@id='add-role-home']//input[contains(@data-bind, 'value: Model.name')]"));

            roleName.SendKeys(data.RoleName);
            var licenseesWidget = new MultiSelectWidget(_driver, By.XPath("//div[contains(@data-bind, 'items: Model.assignedLicensees')]"));

            licenseesWidget.SelectFromMultiSelect(data.Licensee);


            var submittedForm = new SubmittedRoleForm(_driver);

            return(submittedForm);
        }