Skip to content

Commit

Permalink
Unit 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Marohn Howard committed May 16, 2022
1 parent de5ebb2 commit d3d9e52
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
12 changes: 11 additions & 1 deletion 2.2/newFunction.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
export function myFunction() {}
export function myFunction(myNum: number): string {
if (myNum == 5) {
return 'true'
} else if() {

}else if (){

}else {

}
}
34 changes: 34 additions & 0 deletions 2.6/employeeManagerTest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {Builder,By, Capabilities, until, WebDriver, } from "selenium-webdriver";
const chromedriver = require("chromedriver");

const driver: WebDriver = new Builder()
.withCapabilities(Capabilities.chrome())
.build();

class employeePage {
driver: WebDriver;
url: string = "https://devmountain-qa.github.io/employee-manager/1.2_Version/index.html";
//FILL OUT LOCATORS CONSTRUCTOR AND METHODS IN ORDER TO PASS THE TEST
}

describe("Employee Manger Test", () => {
beforeEach(async () => {
await employeePage.navigate();
})
afterAll(async () => {
await driver.quit()
})
test("adding an employee", async () => {
await driver.wait(until.elementLocated(emPage.header))
await driver.findElement(emPage.addEmployee).click()
await driver.findElement(emPage.newEmployee).click()
await driver.findElement(emPage.nameInput).click()
await driver.findElement(emPage.nameInput).clear()
await driver.findElement(emPage.nameInput).sendKeys("Change this")
await driver.findElement(emPage.phoneInput).click()
await driver.findElement(emPage.phoneInput).clear()
await driver.findElement(emPage.phoneInput).sendKeys("Change this")
await driver.findElement(emPage.titleInput).click()
await driver.findElement(emPage.titleInput).clear()
await driver.findElement(emPage.titleInput).sendKeys("Change this")
})
33 changes: 33 additions & 0 deletions 2.6/testWithSelectors.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {Builder, By, Capabilities, WebDriver} from "selenium-webdriver"

const chromedriver = require("chromedriver")

const driver: WebDriver = new Builder().withCapabilities(Capabilities.chrome()).build();

describe("Filling in the blanks", () => {
beforeEach(async () => {
await driver.get('https://devmountain-qa.github.io/enter-wanted/1.4_Assignment/index.html')
});
afterAll(async () => {
await driver.quit();
})

const hdrInput: By = By. //fill in the blank
const mkeInput: By = By. //fill in the blank
const oaiInput: By = By. //fill in the blank
const nameInput: By = By. //fill in the blank
const clrBtn: By = By. //fill in blank
const submitBtn: By = By. //fill in blank
const errorMsg: By = By. // fill in blank

test("filling in the blanks for real", () => {
await driver.findElement(hdrInput).sendKeys("Change this")
await driver.findElement(mkeInput).sendKeys("change this")
await driver.findElement(oaiInput).sendKeys("change this")
await driver.findElement(nameInput).sendKeys("change this")
await driver.findElement(submitBtn).click()
expect(errorMsg).toContain("Errors Received:")
await driver.findElement(clrBtn).click()

})
})

0 comments on commit d3d9e52

Please sign in to comment.