Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
acciojob-2[bot] committed Nov 16, 2023
0 parents commit 1a92544
Show file tree
Hide file tree
Showing 16 changed files with 175 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OTP

The task is to create an application which can basically emulate a otp verification design.
The task is only to design the frontend for the otp veriication design.

![OTP](https://user-images.githubusercontent.com/65496184/219608189-656bec0f-9c47-4826-a45d-6622686c1d36.png)


**Instructions**
-
- The appliaction should have a heading with the `id` **verification_heading**.
- This application also comprise of a subheading with the `id` **verification_subtext** which can be seen in the figure provided.
- There should be a 6 digit input where users can insert numbers and on typing the number the next input should be seen `focused`.
- On backspace key press the number should be deleted from the last filled `input` and the input before it should be `focused`.
- The input container should have an `class` of **code-container** and each input should have a `class` **code** .
4 changes: 4 additions & 0 deletions acciotest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"testRepo": "OTP-solution",
"pathToFile": "cypress/integration/tests/test.spec.js"
}
1 change: 1 addition & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -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"
}
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// 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
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -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) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -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')
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -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;
16 changes: 16 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>

<html>

<head>
<link rel="stylesheet" href="styles.css">
</head>

<body>
<!-- the entire body must be written by student -->
<script type="text/javascript" src="./script.js">
</script>

</body>

</html>
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Accio assignment solution",
"version": "1.0.0",
"description": "Solution Template repo for Acciojob assignments",
"main": "index.js",
"scripts": {
"test": "jest --env=jsdom",
"start": "node server.js"
},
"jest": {
"verbose": true,
"testEnvironment": "jsdom"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cypress": "^9.5.0",
"express": "^4.17.1",
"index.js": "0.0.3",
"jsdom": "^16.5.3",
"supertest": "^6.1.3"
}
}
1 change: 1 addition & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//your JS code here. If required.
4 changes: 4 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const app = require("./index.js");
app.listen(3000, () => {
console.log('server started');
});
1 change: 1 addition & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* your css code here. If applicable */

0 comments on commit 1a92544

Please sign in to comment.