Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('wont let a person disown a project', async function() {
const input = driver.findElement(
By.xpath('//form//tbody/tr[1]//input[@type="text"]')
);
input.clear();
input.sendKeys('blah');
driver.findElement(By.css('button[type="submit"]')).click();
driver.sleep(1000); // modal animation
const errorText = await driver
.findElement(By.css('#error-modal .modal-body'))
.getText();
expect(errorText).toContain('cannot remove yourself');
driver.findElement(By.css('#error-modal button.btn-primary')).click(); // close button
driver.wait(
until.elementIsNotVisible(driver.findElement(By.css('#error-modal')))
);
driver.sleep(1000); // modal animation
public async waitTabFocused(tabTitle: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) {
Logger.debug(`Editor.waitTabFocused "${tabTitle}"`);
const focusedTabLocator: By = By.xpath(`//li[contains(@class, 'p-TabBar-tab') and contains(@class, 'theia-mod-active')]//div[text()='${tabTitle}']`);
await this.driverHelper.waitVisibility(focusedTabLocator, timeout);
}
private getTerminalEditorInteractionEditorLocator(terminalIndex: number): By {
return By.xpath(`(//textarea[@aria-label='Terminal input'])[${terminalIndex}]`);
}
constructor( driver ) {
super( driver, By.xpath( '//XCUIElementTypeTable[@name="SettingsTable"]' ) );
this.tagsSelector = By.xpath( '//XCUIElementTypeTextField[@name="Tags Value"]' );
this.backButtonSelector = By.xpath( '//XCUIElementTypeButton[@name="Back"]' );
}
clickMenuItem( name ) {
const selector = By.xpath( `//XCUIElementTypeStaticText[@name="${name}"]` );
return driverHelper.clickWhenClickableMobile( this.driver, selector );
}
}
async toggleSidebarExpand() {
const {ctx} = this
const btn = ctx.driver.findElement(By.xpath(Elems.btnSideBarExpand))
await btn.click()
}
constructor( driver ) {
super( driver, By.xpath( '//UIATabBar[@name="Main Navigation"]' ) );
this.driver = driver;
}
private getSuggestionLineXpathLocator(suggestionText: string): By {
return By.xpath(`//div[@widgetid='editor.widget.suggestWidget']//span[@class='monaco-highlighted-label' and contains(.,'${suggestionText}')]`);
}
it('can add some friends to the list', async function() {
driver.findElement(By.id('acl-add')).click();
const select2 = driver.findElement(By.xpath('//form//tbody/tr[2]//select'));
const input2 = driver.findElement(
By.xpath('//form//tbody/tr[2]//input[@type="text"]')
);
select2.click();
const select2editor = driver.findElement(
By.xpath('//form//tbody/tr[2]//select/option[@value="editor"]')
);
select2editor.click();
input2.sendKeys('self:fake-editor');
driver.findElement(By.id('acl-add')).click();
const select3 = driver.findElement(By.xpath('//form//tbody/tr[3]//select'));
const input3 = driver.findElement(
By.xpath('//form//tbody/tr[3]//input[@type="text"]')
);
select3.click();
const select3viewer = driver.findElement(
By.xpath('//form//tbody/tr[3]//select/option[@value="viewer"]')
);
select3viewer.click();
input3.sendKeys('self:fake-viewer');
await driver.findElement(By.css('button[type="submit"]')).click();
});
.click();
await driver.findElement(By.css(".dropdown__option:nth-child(24) > .ng-binding"))
.click();
}
const paymentAmount: WebElement = await driver.findElement(By.id("otherAmountInput"));
await paymentAmount.click();
await paymentAmount.sendKeys(card.reloadAmount);
logger.debug("Completed filling Optimum form.");
if (this.completeTransactions)
{
logger.debug("About to submit Optumum payment");
await driver.findElement(By.id("otpSubmit"))
.click();
await driver.findElement(By.xpath("//input[@ng-click='oweAccepted()']"))
.click();
logger.debug("Submitted payment");
card.reloadTimes -= 1;
}
}
}