From b87e7534ce2121e9dd1d809d3c8c0af91bdc24ae Mon Sep 17 00:00:00 2001
From: "acciojob-4[bot]" <123375191+acciojob-4[bot]@users.noreply.github.com>
Date: Sat, 1 Feb 2025 18:23:44 +0000
Subject: [PATCH] Initial commit
---
.github/workflows/test.yml | 10 ++++++++++
.gitignore | 1 +
README.md | 3 +++
acciotest.json | 4 ++++
cypress.json | 1 +
cypress/fixtures/example.json | 5 +++++
cypress/plugins/index.js | 22 ++++++++++++++++++++++
cypress/support/commands.js | 25 +++++++++++++++++++++++++
cypress/support/index.js | 20 ++++++++++++++++++++
index.js | 21 +++++++++++++++++++++
main.html | 16 ++++++++++++++++
package-lock.json | 5 +++++
package.json | 24 ++++++++++++++++++++++++
script.js | 1 +
server.js | 4 ++++
styles.css | 1 +
16 files changed, 163 insertions(+)
create mode 100644 .github/workflows/test.yml
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 acciotest.json
create mode 100644 cypress.json
create mode 100644 cypress/fixtures/example.json
create mode 100644 cypress/plugins/index.js
create mode 100644 cypress/support/commands.js
create mode 100644 cypress/support/index.js
create mode 100644 index.js
create mode 100644 main.html
create mode 100644 package-lock.json
create mode 100644 package.json
create mode 100644 script.js
create mode 100644 server.js
create mode 100644 styles.css
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..55047f4
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,10 @@
+name: Acciojob Tests
+
+on:
+ push:
+ branches: [ "main","master" ]
+
+jobs:
+ calling-acciojob-main-action:
+ uses: acciojob/acciojob-tests-action/.github/workflows/main-action.yml@main
+ secrets: inherit
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..40b878d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+node_modules/
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..646368b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+## Create a card for pricing section of the page as shown below
+
+![card_image](https://storage.googleapis.com/acciojob-open-file-collections/pricing-card.png)
diff --git a/acciotest.json b/acciotest.json
new file mode 100644
index 0000000..af498de
--- /dev/null
+++ b/acciotest.json
@@ -0,0 +1,4 @@
+{
+ "testRepo": "pricing-card-solution",
+ "pathToFile": "cypress/integration/tests/test.spec.js"
+}
diff --git a/cypress.json b/cypress.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/cypress.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json
new file mode 100644
index 0000000..e11abf5
--- /dev/null
+++ b/cypress/fixtures/example.json
@@ -0,0 +1,5 @@
+{
+ "name": "Using fixtures to represent data",
+ "email": "hello@cypress.io",
+ "body": "Fixtures are a great way to mock data for responses to routes"
+}
\ No newline at end of file
diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js
new file mode 100644
index 0000000..0a2b59f
--- /dev/null
+++ b/cypress/plugins/index.js
@@ -0,0 +1,22 @@
+///
+// ***********************************************************
+// This example plugins/index.js can be used to load plugins
+//
+// You can change the location of this file or turn off loading
+// the plugins file with the 'pluginsFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/plugins-guide
+// ***********************************************************
+
+// This function is called when a project is opened or re-opened (e.g. due to
+// the project's config changing)
+
+/**
+ * @type {Cypress.PluginConfig}
+ */
+// eslint-disable-next-line no-unused-vars
+module.exports = (on, config) => {
+ // `on` is used to hook into various events Cypress emits
+ // `config` is the resolved Cypress config
+}
\ No newline at end of file
diff --git a/cypress/support/commands.js b/cypress/support/commands.js
new file mode 100644
index 0000000..66ea16e
--- /dev/null
+++ b/cypress/support/commands.js
@@ -0,0 +1,25 @@
+// ***********************************************
+// This example commands.js 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) => { ... })
\ No newline at end of file
diff --git a/cypress/support/index.js b/cypress/support/index.js
new file mode 100644
index 0000000..63268c1
--- /dev/null
+++ b/cypress/support/index.js
@@ -0,0 +1,20 @@
+// ***********************************************************
+// This example support/index.js is processed and
+// loaded automatically before your test files.
+//
+// This is a great place to put global configuration and
+// behavior that modifies Cypress.
+//
+// You can change the location of this file or turn off
+// automatically serving support files with the
+// 'supportFile' configuration option.
+//
+// You can read more here:
+// https://on.cypress.io/configuration
+// ***********************************************************
+
+// Import commands.js using ES2015 syntax:
+import './commands'
+
+// Alternatively you can use CommonJS syntax:
+// require('./commands')
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..d05aa5b
--- /dev/null
+++ b/index.js
@@ -0,0 +1,21 @@
+// This file is not to be modified. Please ignore this.
+// We will understand all of this later in the course.
+// DO NOT MODIFY THIS FILE
+
+const express = require('express');
+const path = require('path');
+
+const app = express();
+
+app.use(express.static(__dirname))
+
+app.get('/', (req, res) => {
+ res.sendFile(path.join(__dirname + '/main.html'));
+});
+//your code here
+app.post('/add', (req, res) => {
+ const {a,b} = req.body;
+ res.status(200).send(a+b);
+ // res.sendFile(path.join(__dirname + '/main.html'));
+});
+module.exports = app;
\ No newline at end of file
diff --git a/main.html b/main.html
new file mode 100644
index 0000000..b168043
--- /dev/null
+++ b/main.html
@@ -0,0 +1,16 @@
+
+
+
+
+