Skip to content
Snippets Groups Projects
Commit 293c3ae4 authored by Orlando Piñero's avatar Orlando Piñero
Browse files

first tests frontend

parent 4c94bcb0
No related branches found
No related tags found
No related merge requests found
REACT_APP_SERVER=https://127.0.0.1/api
\ No newline at end of file
REACT_APP_SERVER=https://127.0.0.1/api
FIREFOX_DRIVER=selenium driver/geckodriver.exe
\ No newline at end of file
import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
const { Builder, By, Key, until } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const webdriver = process.env.FIREFOX_DRIVER
const service = new firefox.ServiceBuilder(webdriver);
describe("Find Landing Page", () => {
let driver
beforeAll(async () => {
driver = new Builder().forBrowser('firefox').setFirefoxService(service).build();
})
afterAll(async () => {
await driver.quit();
})
it("should find the landing page", async () => {
await driver.get("http://localhost:3000")
const landingPage = await driver.wait(until.elementLocated(By.id("LandingPage")), 5000)
expect(landingPage).toBeDefined();
console.log("Landing page found")
})
})
describe("Find Login-Dialog-Button", () => {
let driver
beforeAll(async () => {
driver = new Builder().forBrowser('firefox').setFirefoxService(service).build();
})
afterAll(async () => {
await driver.quit();
})
it("should find the landing page", async () => {
await driver.get("http://localhost:3000")
const loginDialogButton = await driver.wait(until.elementLocated(By.id("OpenLoginDialogButton")), 5000)
expect(loginDialogButton).toBeDefined();
console.log("OpenLoginDialogButton found")
})
it("should be able to click the Login-Dialog-Button", async () => {
await driver.get("http://localhost:3000")
const loginDialogButton = await driver.wait(until.elementLocated(By.id("OpenLoginDialogButton")), 5000)
expect(loginDialogButton.isEnabled()).toBeTruthy();
console.log("OpenLoginDialogButton can be clicked")
})
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment