Update catcher tests
This commit is contained in:
parent
3188637d07
commit
4130fdcda0
|
@ -21,14 +21,14 @@ const LandingPage: React.FC = () => {
|
|||
</p>
|
||||
<div className="ButtonContainer">
|
||||
<Link to="/login" className="StyledLink">
|
||||
<button className="StyledButton" onClick={handleSubscribeClick}>Create an Account</button>
|
||||
<button name="CreateAccount" className="StyledButton" onClick={handleSubscribeClick}>Create an Account</button>
|
||||
</Link>
|
||||
</div>
|
||||
<p className="Description">
|
||||
Otherwise, you can continue to the flights page.
|
||||
</p>
|
||||
<div className="ButtonContainer">
|
||||
<button className="StyledButton" onClick={handleGoToFlightsClick}>
|
||||
<button name="GoToFlights" className="StyledButton" onClick={handleGoToFlightsClick}>
|
||||
Go to Flights
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@ export const LogIn = () => {
|
|||
<div className="Box Small">
|
||||
<div className="Section">
|
||||
<div className="Section">
|
||||
<h2>Welcome to FIDS!</h2>
|
||||
<h2>Login</h2>
|
||||
<Input
|
||||
placeholder="User"
|
||||
name="User"
|
||||
|
|
|
@ -15,6 +15,12 @@ async function validLogin() {
|
|||
try {
|
||||
await driver.get(process.env.site_url);
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h1[text()='Welcome to FIDS!']", 5000)))
|
||||
|
||||
await driver.wait(until.elementLocated(By.name('CreateAccount'), 5000))
|
||||
|
||||
await driver.findElement(By.name('CreateAccount')).click();
|
||||
|
||||
await driver.findElement(By.name('User'))
|
||||
.sendKeys('info@lufthansa.com');
|
||||
await driver.findElement(By.name('Password'))
|
||||
|
@ -22,8 +28,6 @@ async function validLogin() {
|
|||
|
||||
await driver.findElement(By.name('Login')).click();
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h2[text()='Flights']", 5000)))
|
||||
|
||||
await driver.wait(until.elementLocated(By.name('CreateFlight'), 5000))
|
||||
|
||||
await driver.findElement(By.name('CreateFlight')).click();
|
||||
|
@ -68,9 +72,9 @@ async function validLogin() {
|
|||
|
||||
await driver.findElement(By.name('CreateFlightButton')).click();
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h2[text()='Flights']", 5000)))
|
||||
await driver.wait(until.elementLocated(By.name('CreateFlight'), 5000))
|
||||
|
||||
let actualUrl = process.env.site_url + "/home?page=1";
|
||||
let actualUrl = process.env.site_url + "/flights?page=1";
|
||||
let expectedUrl = await driver.getCurrentUrl();
|
||||
assert.equal(actualUrl, expectedUrl);
|
||||
|
||||
|
|
|
@ -13,7 +13,9 @@ async function validLogin() {
|
|||
.build();
|
||||
|
||||
try {
|
||||
await driver.get(process.env.site_url);
|
||||
await driver.get(process.env.site_url + "/login");
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h2[text()='Login']", 5000)))
|
||||
|
||||
await driver.findElement(By.name('User'))
|
||||
.sendKeys('info@lufthansa.com');
|
||||
|
@ -25,9 +27,9 @@ async function validLogin() {
|
|||
let title = await driver.getTitle();
|
||||
assert.equal("Airport browser", title);
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h2[text()='Flights']", 5000)))
|
||||
await driver.wait(until.elementLocated(By.name('CreateFlight'), 5000))
|
||||
|
||||
let actualUrl = process.env.site_url + "/home?page=1";
|
||||
let actualUrl = process.env.site_url + "/flights?page=1";
|
||||
let expectedUrl = await driver.getCurrentUrl();
|
||||
assert.equal(actualUrl, expectedUrl);
|
||||
|
||||
|
|
|
@ -15,6 +15,16 @@ async function validLogin() {
|
|||
try {
|
||||
await driver.get(process.env.site_url);
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h1[text()='Welcome to FIDS!']", 5000)))
|
||||
|
||||
await driver.wait(until.elementLocated(By.name('CreateAccount'), 5000))
|
||||
|
||||
await driver.findElement(By.name('CreateAccount')).click();
|
||||
|
||||
await driver.wait(until.urlIs(process.env.site_url + "/login"));
|
||||
|
||||
await driver.wait(until.elementLocated(By.name('Signup'), 5000))
|
||||
|
||||
await driver.findElement(By.name('Signup')).click();
|
||||
|
||||
await driver.wait(until.urlIs(process.env.site_url + "/signup"));
|
||||
|
@ -32,9 +42,9 @@ async function validLogin() {
|
|||
|
||||
await driver.findElement(By.name('Signup')).click();
|
||||
|
||||
await driver.wait(until.elementLocated(By.xpath("//h2[text()='Flights']", 5000)))
|
||||
await driver.wait(until.elementLocated(By.name('searchInput'), 5000))
|
||||
|
||||
let actualUrl = process.env.site_url + "/home?page=1";
|
||||
let actualUrl = process.env.site_url + "/flights?page=1";
|
||||
let expectedUrl = await driver.getCurrentUrl();
|
||||
assert.equal(actualUrl, expectedUrl);
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash -e
|
||||
|
||||
catcher -i inventories/local.yaml tests/login.test.yaml
|
||||
catcher -i inventories/local.yaml tests/create-flight.test.yaml
|
||||
catcher -i inventories/local.yaml tests/signup.test.yaml
|
||||
catcher -i inventories/local.yaml tests/auth.test.yaml
|
||||
# catcher tests
|
||||
catcher -i inventories/local.yaml tests
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash -e
|
||||
|
||||
tavern-ci *.yaml
|
||||
|
|
Loading…
Reference in New Issue