mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-01 16:50:12 +08:00
32e212b5a5
These are intended to function as a minimal smoke test that the API interaction with the backend is functional.
27 lines
732 B
TypeScript
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 {};
|