Skip to content

Commit

Permalink
feat: ATG-Console (Automatic Test Generation Console) (#42)
Browse files Browse the repository at this point in the history
* adding files

Signed-off-by: Aditya-eddy <[email protected]>

* adding new changes

Signed-off-by: Aditya-eddy <[email protected]>

* correcting appbar in atg

Signed-off-by: Aditya-eddy <[email protected]>

* making it sidebar-collapsible

Signed-off-by: Aditya-eddy <[email protected]>

* Adding a good-sidebar and good-stepper

Signed-off-by: Aditya-eddy <[email protected]>

* Adding some changes

Signed-off-by: Aditya-eddy <[email protected]>

* adding subscripition

Signed-off-by: Aditya-eddy <[email protected]>

* Adding somechanges

Signed-off-by: Aditya-eddy <[email protected]>

* Adding code changes

Signed-off-by: Aditya-eddy <[email protected]>

* adding some changes

Signed-off-by: Aditya-eddy <[email protected]>

* adding new changes also adding test function

Signed-off-by: Aditya-eddy <[email protected]>

* adding various changes and language selector

Signed-off-by: Aditya-eddy <[email protected]>

* removing build errors

Signed-off-by: Aditya-eddy <[email protected]>

* adding caret cursor to terminal and styling terminal

Signed-off-by: Aditya-eddy <[email protected]>

* adding new terminal

Signed-off-by: Aditya-eddy <[email protected]>

* adding width config correctly

Signed-off-by: Aditya-eddy <[email protected]>

* Adding light mode

Signed-off-by: Aditya-eddy <[email protected]>

* adding dark mode

Signed-off-by: Aditya-eddy <[email protected]>

* adding info and dots

Signed-off-by: Aditya-eddy <[email protected]>

* adding the atom one Dark theme

Signed-off-by: Aditya-eddy <[email protected]>

* Adding new changes for editor

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the atg feature

Signed-off-by: Aditya-eddy <[email protected]>

* adding some changes to the editor

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the testing

Signed-off-by: Aditya-eddy <[email protected]>

* removing un-necessary icons

Signed-off-by: Aditya-eddy <[email protected]>

* adding testing-terminal changes

Signed-off-by: Aditya-eddy <[email protected]>

* Adding new changes

Signed-off-by: Aditya-eddy <[email protected]>

* adding the some changes

Signed-off-by: Aditya-eddy <[email protected]>

* removing comments

Signed-off-by: Aditya-eddy <[email protected]>

* removing the linting changes in tailwindconfig.json

Signed-off-by: Aditya-eddy <[email protected]>

* removing

Signed-off-by: Aditya-eddy <[email protected]>

* removing2

Signed-off-by: Aditya-eddy <[email protected]>

* Adding some suggested changes

Signed-off-by: Aditya-eddy <[email protected]>

* Adding new File-Structure for gql

Signed-off-by: Aditya-eddy <[email protected]>

* adding single terminal file and making single file-structure

Signed-off-by: Aditya-eddy <[email protected]>

* fetching file structure based on the github repo

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the subscription hooks

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the demo-project as sub-module

Signed-off-by: Aditya-eddy <[email protected]>

* adding the changes in the queries-changes

Signed-off-by: Aditya-eddy <[email protected]>

* adding a simple dir

Signed-off-by: Aditya-eddy <[email protected]>

* Adding api for file-structure

Signed-off-by: Aditya-eddy <[email protected]>

* adding demo

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the changes

Signed-off-by: Aditya-eddy <[email protected]>

* removing logs

Signed-off-by: Aditya-eddy <[email protected]>

* Adding test-sets

Signed-off-by: Aditya-eddy <[email protected]>

* adding the subscriptions

Signed-off-by: Aditya-eddy <[email protected]>

* Adding the final changes

Signed-off-by: Aditya-eddy <[email protected]>

* removing unwanted-files

Signed-off-by: Aditya-eddy <[email protected]>

* correcting the speed of logs

Signed-off-by: Aditya-eddy <[email protected]>

* Adding some new changes

Signed-off-by: Aditya-eddy <[email protected]>

* setting terminal height according to buttons & correcting the reportFiles and Cotent for report Files

Signed-off-by: Aditya-eddy <[email protected]>

* Seprating File-Tree Components

Signed-off-by: Aditya-eddy <[email protected]>

* adding enum command and all of the file-tree-components changes

Signed-off-by: Aditya-eddy <[email protected]>

* chore:adding changes

Signed-off-by: Aditya-eddy <[email protected]>

* package.json

Signed-off-by: Aditya-eddy <[email protected]>

* chore:correcting the input box and downlading the keploy

Signed-off-by: Aditya-eddy <[email protected]>

* fix: reset button

Signed-off-by: Yash Khare <[email protected]>

---------

Signed-off-by: Aditya-eddy <[email protected]>
Signed-off-by: Yash Khare <[email protected]>
Co-authored-by: Neha Gupta <[email protected]>
Co-authored-by: Yash Khare <[email protected]>
Co-authored-by: Animesh Pathak <[email protected]>
  • Loading branch information
4 people authored Oct 22, 2024
1 parent 2b53e4d commit 093e221
Show file tree
Hide file tree
Showing 65 changed files with 5,919 additions and 207 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "components/atg/demo-projects"]
path = components/atg/demo-projects
url = https://github.com/keploy/demo-projects.git
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}
35 changes: 18 additions & 17 deletions app/(default)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
"use client";

import { useEffect } from 'react'
import { useEffect } from "react";

import AOS from 'aos'
import 'aos/dist/aos.css'
import AOS from "aos";
import "aos/dist/aos.css";

import Footer from "@/components/ui/footer";
import { ApolloProvider } from "@apollo/client";
import client from "../lib/apollo-client";

export default function DefaultLayout({
children,
}: {
children: React.ReactNode
}) {

children: React.ReactNode;
}) {
useEffect(() => {
AOS.init({
once: true,
disable: 'phone',
disable: "phone",
duration: 700,
easing: 'ease-out-cubic',
})
})
easing: "ease-out-cubic",
});
});

return (
<>
<main className="grow bg-neutral-100 z-10">

{children}

</main>
<ApolloProvider client={client}>
<main className="grow bg-neutral-100 z-10">{children}</main>

{/*<Footer />*/}
{/*<Footer />*/}
</ApolloProvider>
</>
)
);
}
70 changes: 35 additions & 35 deletions app/(default)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import Footer from "@/components/ui/footer";

import Hero from '@/components/hero'
import Features from '@/components/features'
import ProblemBlocks from '@/components/problem-blocks'
import Newsletter from '@/components/newsletter'
import Hero from "@/components/hero";
import Features from "@/components/features";
import ProblemBlocks from "@/components/problem-blocks";
import Newsletter from "@/components/newsletter";
import Language from "@/components/language";
import Community from "@/components/community";
import Installation from "@/components/installation";
import { Testimonial } from "@/components/testimonial";
import { testimonialData } from "@/components/utils/testimonial";
import TwitterTestimonials from "@/components/TwitterTestimonials";
import Header from "@/components/ui/header";
export default function Home() {
return (
<>
<Header/>
<Hero />
<Features />

<Testimonial
content={testimonialData[0].content}
author={testimonialData[0].author}
company={testimonialData[0].company}
image={testimonialData[0].image}
/>
<Installation/>
<Testimonial
content={testimonialData[2].content}
author={testimonialData[2].author}
company={testimonialData[2].company}
image={testimonialData[2].image}
/>
<Community />
<Testimonial
content={testimonialData[1].content}
author={testimonialData[1].author}
company={testimonialData[1].company}
image={testimonialData[1].image}
/>
<Language />
<ProblemBlocks />
<TwitterTestimonials/>
<Newsletter />
<Footer />
<Hero />
<Features />

<Testimonial
content={testimonialData[0].content}
author={testimonialData[0].author}
company={testimonialData[0].company}
image={testimonialData[0].image}
/>

<Installation/>

<Testimonial
content={testimonialData[2].content}
author={testimonialData[2].author}
company={testimonialData[2].company}
image={testimonialData[2].image}
/>
<Community />
<Testimonial
content={testimonialData[1].content}
author={testimonialData[1].author}
company={testimonialData[1].company}
image={testimonialData[1].image}
/>
<Language />
<ProblemBlocks />
<TwitterTestimonials />
<Newsletter />
<Footer />
</>
)
);
}
11 changes: 11 additions & 0 deletions app/(default)/playground/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import Editor from "@/components/atg/editor";
const page = () => {
return (
<div className="mt-24">
<Editor goFullScreen={true} />
</div>
);
};

export default page;
32 changes: 19 additions & 13 deletions app/(default)/test-case-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,27 @@ import { Testimonial } from "@/components/testimonial";
import { testimonialData } from "@/components/utils/testimonial";
import testAndStubsGen from "@/public/images/TestGenHighlighted.json";
import { blocksData } from "@/components/utils/common";
import { featuresData,faqQuestions } from "@/components/utils/test-case-generator";
import {
featuresData,
faqQuestions,
} from "@/components/utils/test-case-generator";
import BannerBunny from "@/public/images/banner-bunny.png";
import FAQ from "@/components/pillar-page/faq";
import RootLayout, { Metadata } from "@/app/layout";

const pageMetadata: Metadata = {
title: 'Keploy | Boost E2E Testing with Keploy Test Case Generator! Learn How',
description: 'Stop wasting time! Imagine waking up to ready-made test cases. Keploy.io test case generation makes it possible saving you hours. Click to learn how!',
keywords: 'test case generation',
title:
"Keploy | Boost E2E Testing with Keploy Test Case Generator! Learn How",
description:
"Stop wasting time! Imagine waking up to ready-made test cases. Keploy.io test case generation makes it possible saving you hours. Click to learn how!",
keywords: "test case generation",
};

const heroData = {
titleTop: "Improve Tests with ",
titleBottom: "E2E Test Generator",
subtitleTop: "Avoid confusion and Duplication in Test Execution!",
subtitleBottom:
"Remove the duplicate and redundant test cases in minutes. 🚀",
"Remove the duplicate and redundant test cases in minutes. Try our new Automatic test Generator 🚀",
animationSrc: testAndStubsGen,
};
const ProblemBlocksData = {
Expand Down Expand Up @@ -60,8 +64,10 @@ export default function Home() {
titleBottom={heroData.titleBottom}
subtitleTop={heroData.subtitleTop}
subtitleBottom={heroData.subtitleBottom}
animationSrc={heroData.animationSrc}
editor={true}
extraClasses="text-center" // Pass this to ensure text is centered
/>

<ProblemBlocks
title={ProblemBlocksData.title}
subtitle={ProblemBlocksData.subtitle}
Expand All @@ -71,7 +77,7 @@ export default function Home() {
<Features
title={FeaturesData.title}
subtitle={FeaturesData.subtitle}
highlightTitle={FeaturesData.highlightTitle}
highlightTitle={FeaturesData.highlightTitle}
title2={FeaturesData.title2}
featuresData={FeaturesData.featuresData}
/>
Expand All @@ -90,11 +96,11 @@ export default function Home() {
/>
<Language />
<Testimonial
content={testimonialData[2].content}
author={testimonialData[2].author}
company={testimonialData[2].company}
image={testimonialData[2].image}
/>
content={testimonialData[2].content}
author={testimonialData[2].author}
company={testimonialData[2].company}
image={testimonialData[2].image}
/>
<FAQ questions={faqQuestions} />
<Banner
title={BannerData.title}
Expand Down
83 changes: 83 additions & 0 deletions app/api/automatic-test-generator/Mutation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { SUBMIT_CODE_MUTATION } from "./queries";
export const submitCodeSnippet = async ({
language,
schema,
code,
}: {
language: string;
schema: string;
code: string;
}) => {
try {
const headers = {
"Content-Type": "application/json",
};

const requestBody = {
query: SUBMIT_CODE_MUTATION
,
variables: { language, schema, code },
};

const options: RequestInit = {
method: "POST",
headers,
body: JSON.stringify(requestBody),
};

const response = await fetch(
"https://landing-page.staging.keploy.io/query",
options
);
const responseData = await response.json();

if (response.ok && responseData?.data?.submitCode?.code_submission_id) {
return responseData.data.submitCode.code_submission_id;
} else {
console.error("Error in response:", responseData.errors || responseData);
return null;
}
} catch (err) {
if (err instanceof Error) {
if (err.name === "AbortError") {
console.error("Fetch aborted");
} else {
console.error("ERROR DURING FETCH REQUEST", err);
}
} else {
console.error("An unknown error occurred", err);
}
return null;
}
};

export type CommandResponse = {
success: boolean;
data?: any;
error?: string;
};

export async function postRequest(
endpoint: string,
query: string,
variables: any
): Promise<CommandResponse> {
try {
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
query,
variables,
}),
});

const data = await response.json();
return { success: response.ok, data };
} catch (error: any) {
return { success: false, error: error.message };
}
}

Loading

0 comments on commit 093e221

Please sign in to comment.