Files
Open-Assistant/website/cypress/e2e/create/user_reply.cy.ts
T
Adrian Cowan 32e212b5a5 website: Add e2e tests of creating an assistant/prompter reply
These are intended to function as a minimal smoke test that the API interaction with the backend is functional.
2023-01-02 21:13:10 +11:00

27 lines
732 B
TypeScript

import { faker } from "@faker-js/faker";
describe("replying as the prompter", () => {
it("completes the current task on submit and on request shows a new task", () => {
cy.signInWithEmail("cypress@example.com");
cy.visit("/create/user_reply");
cy.get('[data-cy="task-id"').then((taskIdElement) => {
const taskId = taskIdElement.text();
const reply = faker.lorem.sentence();
cy.log("reply", reply);
cy.get('[data-cy="reply"').type(reply);
cy.get('[data-cy="submit"]').click();
cy.get('[data-cy="next-task"]').click();
cy.get('[data-cy="task-id"').should((taskIdElement) => {
expect(taskIdElement.text()).not.to.eq(taskId);
});
});
});
});
export {};