Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private static async verifyChallengesMatchingKeyword(filters: Array) {
// need to sleep to wait for ajax calls to be completed to filter using the above keyword
await browser.sleep(15000);
const challenges = await ChallengeListingPageObject.challengeLinks;
for (let i = 0; i < challenges.length; i++) {
const parentDiv = challenges[i].element(by.xpath('..'));
let skills = await parentDiv.all(by.css('button[type=button]'));
// expand skills by clicking on the hidden `+x` button
for (let i = 0; i < skills.length; i++) {
const skill = await skills[i];
const text = await skill.getText();
if (text[0] == '+') {
await skill.click();
}
}
skills = parentDiv.all(by.css('button[type=button]'));
const skillsText = await skills.getText();
expect(skillsText.filter((s: string) => {
for (let j = 0; j < filters.length; j++) {
if (s.includes(filters[j])) {
getMetricesRequestCount() {
return element(by.xpath('//div[contains(text(),"10")]'));
}
// Environment Locators
getDropDown() {
return element(by.xpath('//div[text()="TIME RANGE"]/following-sibling::dropdown[@title="Select range"]/div[@class="dropdown"]/button[@class="btn dropdown-btn dropdown-toggle"]'));
}
getWeekVerify() {
btn_CreateBranch() {
return element(by.xpath('//input[@id="create-branch-submit"]'));
}
bitUsername() {
stepContainerDeleteButton(stepName: string) {
return element(by.xpath(`//h3[@class="step-name" and contains(text(), "${stepName}")]/../div/div/mat-icon`));
}
clearFinalButton() {
return element(by.xpath('//div[contains(text(),\' Final\')]/..//button'));
}
clearStagingButton() {
return element(by.xpath('//div[contains(text(),\' Staging\')]/..//button'));
}
checkRowIsSelected(content) {
let isRowSelected = this.getRowsName(content).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
Util.waitUntilElementIsVisible(isRowSelected);
}
matchThresholdOtherURI(name: string) {
return element(by.xpath(`//mat-row[contains(@class, 'match-threshold-${name.toLowerCase()}')]
//mat-cell//div//div//span[@class="action-label" and contains(text(), "URI")]/..`));
}