Skip to content

Commit

Permalink
cypress migration
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Feb 6, 2024
1 parent b4bbfd4 commit 9b23443
Show file tree
Hide file tree
Showing 38 changed files with 2,525 additions and 1,177 deletions.
21 changes: 21 additions & 0 deletions cypress/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
This software is Copyright ©️ 2020 The University of Southern California. All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational, research and non-profit purposes, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and subject to the full license file found in the root of this software deliverable. Permission to make commercial use of this software may be obtained by contacting: USC Stevens Center for Innovation University of Southern California 1150 S. Olive Street, Suite 2300, Los Angeles, CA 90115, USA Email: [email protected]
The full terms of this copyright and license should always be found in the root directory of this software deliverable as "license.txt" and if these terms are not found with this software, please contact the USC Stevens Center for the full license.
*/
import { defineConfig } from "cypress";

export default defineConfig({
video: false,
chromeWebSecurity: false,
requestTimeout: 10000,
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require("./cypress/plugins/index.ts")(on, config);
},
baseUrl: "http://localhost:80",
},
});
7 changes: 0 additions & 7 deletions cypress/cypress.json

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Connection,
Question,
QuestionType,
Subject,
SubjectTypes,
UserRole,
} from "../support/types";
Expand All @@ -18,9 +19,10 @@ const mentor = {
_id: "clint",
};

const subject = {
const subject: Subject = {
_id: "background",
name: "Background",
isArchived: false,
type: SubjectTypes.SUBJECT,
description:
"These questions will ask general questions about your background that might be relevant to how people understand your career.",
Expand All @@ -30,6 +32,7 @@ const subject = {
id: "c1",
name: "Category1",
description: "1",
defaultTopics: [],
},
],
topics: [
Expand All @@ -48,9 +51,10 @@ const subject = {
name: "",
paraphrases: ["paraphrase1"],
mentor: null,
clientId: "",
},
topics: [{ id: "t1" }],
category: { id: "c1" },
topics: [{ id: "t1", name: "", description: "" }],
category: { id: "c1", name: "", description: "", defaultTopics: [] },
},
{
question: {
Expand All @@ -60,6 +64,7 @@ const subject = {
name: "",
paraphrases: [],
mentor: "clint",
clientId: "",
},
topics: [],
category: null,
Expand All @@ -72,14 +77,15 @@ const subject = {
name: "",
paraphrases: [],
mentor: "notclint",
clientId: "",
},
topics: [],
category: null,
},
],
};

const utteranceSubject = {
const utteranceSubject: Subject = {
...subject,
type: SubjectTypes.UTTERANCES,
isArchived: false,
Expand Down Expand Up @@ -645,6 +651,7 @@ describe("Edit subject", () => {
id: "c2",
name: "category 2",
description: "2",
defaultTopics: [],
},
],
},
Expand All @@ -660,6 +667,7 @@ describe("Edit subject", () => {
{
id: "c2",
name: "category 2",
defaultTopics: [],
description: "2",
},
],
Expand Down Expand Up @@ -767,6 +775,7 @@ describe("Edit subject", () => {
{
id: "c1",
name: "Category1 Edited",
defaultTopics: [],
description: "1 Edited",
},
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion cypress/cypress/fixtures/mentor/clint_home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const mentor: Mentor = {
keywords: [],
subjects: [
{
isArchived: false,
_id: "background",
name: "Background",
type: SubjectTypes.SUBJECT,
Expand All @@ -37,6 +38,7 @@ export const mentor: Mentor = {
{
id: "category",
name: "Category",
defaultTopics: [],
description: "A category",
},
],
Expand All @@ -53,6 +55,7 @@ export const mentor: Mentor = {
},
topics: [],
category: {
defaultTopics: [],
id: "category",
name: "Category",
description: "A category",
Expand All @@ -72,6 +75,7 @@ export const mentor: Mentor = {
],
},
{
isArchived: false,
_id: "idle_and_initial_recordings",
name: "Idle and Initial Recordings",
type: SubjectTypes.UTTERANCES,
Expand All @@ -80,6 +84,7 @@ export const mentor: Mentor = {
categories: [
{
id: "category2",
defaultTopics: [],
name: "Category2",
description: "Another category",
},
Expand Down Expand Up @@ -124,6 +129,7 @@ export const mentor: Mentor = {
},
topics: [],
category: {
defaultTopics: [],
id: "category2",
name: "Category2",
description: "Another category",
Expand Down Expand Up @@ -175,7 +181,7 @@ export const mentor: Mentor = {
name: UtteranceName.IDLE,
paraphrases: [],
},
media: [{ url: "video.mp4", tag: "idle", type: "video" }],
media: [{ url: "video.mp4", tag: "idle", type: "video", vttText: "" }],
transcript: "",
status: Status.COMPLETE,
},
Expand Down
9 changes: 8 additions & 1 deletion cypress/cypress/fixtures/mentor/clint_home_new_questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const mentor: Mentor = {
keywords: [],
subjects: [
{
isArchived: false,
_id: "background",
name: "Background",
type: SubjectTypes.SUBJECT,
Expand All @@ -38,6 +39,7 @@ export const mentor: Mentor = {
id: "category",
name: "Category",
description: "A category",
defaultTopics: [],
},
],
topics: [],
Expand All @@ -56,6 +58,7 @@ export const mentor: Mentor = {
id: "category",
name: "Category",
description: "A category",
defaultTopics: [],
},
},
{
Expand All @@ -72,6 +75,7 @@ export const mentor: Mentor = {
],
},
{
isArchived: false,
_id: "idle_and_initial_recordings",
name: "Idle and Initial Recordings",
type: SubjectTypes.UTTERANCES,
Expand All @@ -82,6 +86,7 @@ export const mentor: Mentor = {
id: "category2",
name: "Category2",
description: "Another category",
defaultTopics: [],
},
],
topics: [],
Expand Down Expand Up @@ -126,6 +131,7 @@ export const mentor: Mentor = {
category: {
id: "category2",
name: "Category2",
defaultTopics: [],
description: "Another category",
},
},
Expand All @@ -142,6 +148,7 @@ export const mentor: Mentor = {
topics: [],
category: {
id: "category2",
defaultTopics: [],
name: "Category2",
description: "Another category",
},
Expand Down Expand Up @@ -192,7 +199,7 @@ export const mentor: Mentor = {
name: UtteranceName.IDLE,
paraphrases: [],
},
media: [{ url: "video.mp4", tag: "idle", type: "video" }],
media: [{ url: "video.mp4", tag: "idle", type: "video", vttText: "" }],
transcript: "",
status: Status.COMPLETE,
},
Expand Down
15 changes: 14 additions & 1 deletion cypress/cypress/fixtures/mentor/clint_markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const mentor: Mentor = {
],
subjects: [
{
isArchived: false,
_id: "background",
name: "Background",
type: SubjectTypes.SUBJECT,
Expand All @@ -47,6 +48,7 @@ export const mentor: Mentor = {
{
id: "category",
name: "Category",
defaultTopics: [],
description: "A category",
},
],
Expand All @@ -63,6 +65,7 @@ export const mentor: Mentor = {
},
topics: [],
category: {
defaultTopics: [],
id: "category",
name: "Category",
description: "A category",
Expand All @@ -82,13 +85,15 @@ export const mentor: Mentor = {
],
},
{
isArchived: false,
_id: "repeat_after_me",
name: "Repeat After Me",
type: SubjectTypes.UTTERANCES,
description: "These are miscellaneous phrases you'll be asked to repeat.",
isRequired: true,
categories: [
{
defaultTopics: [],
id: "category2",
name: "Category2",
description: "Another category",
Expand All @@ -106,6 +111,7 @@ export const mentor: Mentor = {
paraphrases: [],
mentorType: MentorType.VIDEO,
minVideoLength: 10,
clientId: "",
},
topics: [],
},
Expand All @@ -117,6 +123,7 @@ export const mentor: Mentor = {
type: QuestionType.UTTERANCE,
name: UtteranceName.INTRO,
paraphrases: [],
clientId: "",
},
topics: [],
},
Expand All @@ -128,9 +135,15 @@ export const mentor: Mentor = {
type: QuestionType.UTTERANCE,
name: UtteranceName.OFF_TOPIC,
paraphrases: [],
clientId: "",
},
topics: [],
category: { id: "category2" },
category: {
defaultTopics: [],
id: "category2",
name: "Category2",
description: "Another category",
},
},
],
},
Expand Down
9 changes: 9 additions & 0 deletions cypress/cypress/fixtures/mentor/clint_new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const mentor: Mentor = {
],
subjects: [
{
isArchived: false,
_id: "background",
name: "Background",
type: SubjectTypes.SUBJECT,
Expand All @@ -50,10 +51,12 @@ export const mentor: Mentor = {
{
id: "category1",
name: "Category1",
defaultTopics: [],
description: "A category",
},
{
id: "category3",
defaultTopics: [],
name: "Category3",
description: "",
},
Expand Down Expand Up @@ -85,6 +88,7 @@ export const mentor: Mentor = {
id: "category",
name: "Category",
description: "A category",
defaultTopics: [],
},
},
{
Expand All @@ -101,6 +105,7 @@ export const mentor: Mentor = {
],
},
{
isArchived: false,
_id: "idle_and_initial_recordings",
name: "Idle and Initial Recordings",
type: SubjectTypes.UTTERANCES,
Expand All @@ -111,11 +116,13 @@ export const mentor: Mentor = {
id: "category2",
name: "Category2",
description: "Another category",
defaultTopics: [],
},
{
id: "category4",
name: "Category4",
description: "",
defaultTopics: [],
},
],
topics: [
Expand Down Expand Up @@ -172,6 +179,7 @@ export const mentor: Mentor = {
id: "category2",
name: "Category2",
description: "Another category",
defaultTopics: [],
},
},
{
Expand All @@ -189,6 +197,7 @@ export const mentor: Mentor = {
id: "category2",
name: "Category2",
description: "Another category",
defaultTopics: [],
},
},
],
Expand Down
File renamed without changes.
Loading

0 comments on commit 9b23443

Please sign in to comment.