Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('waitForText should wait for an element to contain a text', () => {
waitForTextToBe(waitsPage.waitForText, 'match');
expect(waitsPage.waitForText.getText()).toBe('match');
});
it('selectOptionByIndex should select an option', async () => {
const option = 'option2';
await selectOptionByIndex(actionsPage.select, 1);
await waitForTextToBe(actionsPage.selectResult, option);
await expect(getText(actionsPage.selectResult)).toBe(option);
});
it('sendKeys should send keys to input the button', () => {
const text = 'keys to send';
sendKeys(actionsPage.sendKeysInput, text);
waitForTextToBe(actionsPage.inputResult, text);
expect(getText(actionsPage.inputResult)).toBe(text);
});
it('waitForTextToBe should wait for an element to contain a text', async () => {
await waitForTextToBe(waitsPage.waitForText, 'match');
await expect(waitsPage.waitForText.getText()).toBe('match');
});
it('sendKeys should send keys to input the button', async () => {
const text = 'keys to send';
await sendKeys(actionsPage.sendKeysInput, text);
await waitForTextToBe(actionsPage.inputResult, text);
await expect(getText(actionsPage.inputResult)).toBe(text);
});
it('selectOption should select an option', () => {
const option = 'option2';
selectOption(
actionsPage.select.element(
by.cssContainingText(actionsPage.optionSelector, option)
)
);
waitForTextToBe(actionsPage.selectResult, option);
expect(getText(actionsPage.selectResult)).toBe(option);
});
it('should add one and two', () => {
sendKeys(firstNumber, '1');
sendKeys(secondNumber, '2');
click(goButton);
waitForTextToBe(latestResult, '3');
expect(getText(latestResult), '3');
});
});