Refactor tests
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Selector } from "testcafe";
|
||||
|
||||
fixture`Page renders correctly`.page("http://localhost:3000");
|
||||
fixture`Front page renders and functions correctly`.page("http://localhost:3000");
|
||||
|
||||
test("Favicon exists", async t => {
|
||||
/**
|
||||
@@ -32,8 +32,6 @@ test("Header contains text \"Aalto-yliopiston sähköinsinöörikilta!\"", async
|
||||
.contains("Aalto-yliopiston sähköinsinöörikilta!");
|
||||
});
|
||||
|
||||
fixture`Increment button`.page("http://localhost:3000");
|
||||
|
||||
test("Increment button functions correctly", async t => {
|
||||
/**
|
||||
* Test if the increment button works and increments the number inside the button
|
||||
@@ -44,12 +42,10 @@ test("Increment button functions correctly", async t => {
|
||||
await t.expect(button.textContent).contains("1");
|
||||
});
|
||||
|
||||
fixture`Posts from API`.page("http://localhost:3000");
|
||||
|
||||
test("At least one post exists", async t => {
|
||||
/**
|
||||
* Test if the API responds with at least one post and it is rendered to the page
|
||||
*/
|
||||
const post = Selector(".post");
|
||||
await t.expect(post.exists).ok();
|
||||
await t.expect(post.count).gte(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user