Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress-setup #67

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0079312
first changes on UI-branch
ROXBOZ Jun 16, 2023
fa05937
codac-Clean_UI brought to mono repo
ROXBOZ Jun 21, 2023
fdcfc40
config MONOREPO
ROXBOZ Jun 21, 2023
3052281
Merge pull request #57 from CodeAcademyBerlin/Roxanne---UI
Loukass23 Jun 21, 2023
19c753a
problem with .map key.id solved in chat and function delete created
ch-vargaso Jun 22, 2023
5c52197
changes done...
ch-vargaso Jun 22, 2023
b921163
changes and answers...
ch-vargaso Jun 22, 2023
d4ceefa
created storybook bubble
ROXBOZ Jun 22, 2023
ce541c8
creating new chat from scratch...
ch-vargaso Jun 23, 2023
bc76c30
create function working in the chat...
ch-vargaso Jun 23, 2023
075bf6a
delete function working...
ch-vargaso Jun 23, 2023
0674076
chat demo
ch-vargaso Jun 25, 2023
9992c96
chat demo
ch-vargaso Jun 25, 2023
5103116
chatroom query added to usercontext + commented out "Pages" in cours…
Doron-Breska Jun 26, 2023
72e950b
new chatrooms variable in authContext
Doron-Breska Jun 26, 2023
00f5b81
updated types for authContext
Doron-Breska Jun 26, 2023
b13373e
update query in [chatId].tsx
Doron-Breska Jun 26, 2023
a9d29be
implemented the bubble inside the chat
ROXBOZ Jun 26, 2023
1760e9e
changed color for clarity
ROXBOZ Jun 26, 2023
b0da2f6
my changes
ch-vargaso Jun 26, 2023
e35da28
Merge branch 'christians-branch' of https://github.com/CodeAcademyBer…
ch-vargaso Jun 26, 2023
621e9c5
debugin after error after pull... now is working
ch-vargaso Jun 26, 2023
6ee2e27
added query to get all pinned msgs
CosmosMil Jun 26, 2023
2dacb56
added fetch for all pinned msgs
CosmosMil Jun 26, 2023
b20f0f4
changes added
ch-vargaso Jun 27, 2023
016a2e9
Merge 'main' into cobalt-kangaroos-integration
Madame-Aehm Jun 27, 2023
e08166c
Merge branch 'main' into cobalt-kangaroos-integration
Loukass23 Jun 27, 2023
57293f7
Merge pull request #58 from ROXBOZ/Roxanne---UI
Loukass23 Jun 27, 2023
fdf6657
folder renamed
ch-vargaso Jun 27, 2023
281f642
Merge branch 'cobalt-kangaroos-integration' into christians-branch
Loukass23 Jun 27, 2023
a9a1e89
Merge pull request #60 from CodeAcademyBerlin/christians-branch
Loukass23 Jun 27, 2023
1cbf4b4
Merge branch 'cobalt-kangaroos-integration' of https://github.com/Cod…
Madame-Aehm Jun 27, 2023
2d8e34c
update .gitignore
Madame-Aehm Jun 27, 2023
b69c8ff
div for conversations and pinned conversations
ch-vargaso Jun 27, 2023
b916e95
distribution of the divs
ch-vargaso Jun 28, 2023
be88349
Merge branch 'christian-branch' into cobalt-kangaroos-integration
Madame-Aehm Jun 28, 2023
da5fb50
pinned conversation done
PabloXberg Jun 29, 2023
88cc65a
cypress setup
Loukass23 Jul 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/codac-quasseln/.env.local.example

This file was deleted.

16 changes: 16 additions & 0 deletions apps/codac-quasseln/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from "cypress";

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},

component: {
devServer: {
framework: "next",
bundler: "webpack",
},
},
});
18 changes: 18 additions & 0 deletions apps/codac-quasseln/cypress/e2e/app.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// cypress/integration/app.spec.js

describe("Navigation", () => {
it("should navigate to the dashboard page", () => {
// Start from the index page
cy.visit("http://localhost:3000/");
// The new page should contain an h1 with "About page"
cy.get("div").contains("CODAC");
// Find a link with an href attribute containing "dashboard" and click it
cy.get('a[href*="dashboard"]').click();

// The new url should include "/dashboard"
cy.url().should("include", "/dashboard");
});
});

const asModule = {};
export default asModule;
23 changes: 23 additions & 0 deletions apps/codac-quasseln/cypress/e2e/login.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe("Login", () => {
it("should login from dashboard page", () => {
//load user data from fixtures
cy.fixture("user").then((user) => {
// Start from the dashboard page
cy.visit("http://localhost:3000/dashboard");

// Find a link with an href attribute containing "login" and click it
cy.get("button").contains("Sign In").click();
// Find email input and type in email
cy.get('input[name="email"]').type(user.email);
// Find password input and type in password
cy.get('input[name="password"]').type(user.password);
// Find button with text "Sign In" and click it
cy.get('button[name="login"]').click();

// Page should includes a button with text "Log Out"
cy.get("button").contains("log out");
// there should be a cookie with name 'token'
cy.getCookie("codac-token").should("exist");
});
});
});
244 changes: 244 additions & 0 deletions apps/codac-quasseln/cypress/fixtures/chats.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
{
"data": {
"chats": {
"data": [
{
"id": "1",
"attributes": {
"name": "Scouts",
"messages": [
{
"body": "qsfzesfze",
"timestamp": "2023-06-14T11:14:19.933Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "azdazd",
"timestamp": "2023-06-14T11:15:11.443Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "hello",
"timestamp": null,
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "test",
"timestamp": "2023-06-14T11:19:48.481Z",
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "XQqx",
"timestamp": "2023-06-14T11:20:00.051Z",
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "test",
"timestamp": "2023-06-14T11:20:57.062Z",
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "ddddddddddddd",
"timestamp": "2023-06-14T11:21:44.398Z",
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "ghnghn",
"timestamp": "2023-06-14T13:45:53.737Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "dddd",
"timestamp": "2023-06-14T14:29:28.189Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "hello",
"timestamp": "2023-06-15T10:56:13.410Z",
"author": {
"data": {
"attributes": {
"username": "armin"
}
}
}
}
]
}
},
{
"id": "2",
"attributes": {
"name": "Kangaroos",
"messages": [
{
"body": "hello",
"timestamp": "2023-06-13T14:05:41.640Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "hello",
"timestamp": "2023-06-14T11:20:20.511Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "update",
"timestamp": "2023-06-14T11:20:45.958Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "bfgbf",
"timestamp": "2023-06-14T11:51:54.175Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "fngfgnfgn",
"timestamp": "2023-06-14T11:52:03.062Z",
"author": {
"data": {
"attributes": {
"username": "lucas"
}
}
}
},
{
"body": "Jessica made it here!",
"timestamp": "2023-06-14T14:19:21.112Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "pranab auch hier",
"timestamp": "2023-06-15T09:18:53.356Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "me toooo ",
"timestamp": "2023-06-16T08:47:49.750Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "eeeeqweqweqew",
"timestamp": "2023-06-16T11:29:29.018Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
},
{
"body": "eeeeqweqweqew",
"timestamp": "2023-06-16T11:29:29.017Z",
"author": {
"data": {
"attributes": {
"username": "mikasa"
}
}
}
}
]
}
}
]
}
}
}
4 changes: 4 additions & 0 deletions apps/codac-quasseln/cypress/fixtures/user.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"email": "[email protected]",
"password": "[email protected]"
}
37 changes: 37 additions & 0 deletions apps/codac-quasseln/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
//
// declare global {
// namespace Cypress {
// interface Chainable {
// login(email: string, password: string): Chainable<void>
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
14 changes: 14 additions & 0 deletions apps/codac-quasseln/cypress/support/component-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Components App</title>
<!-- Used by Next.js to inject CSS. -->
<div id="__next_css__DO_NOT_USE__"></div>
</head>
<body>
<div data-cy-root></div>
</body>
</html>
Loading