├── cypress.json ├── cypress ├── fixtures │ ├── example.json │ └── createuser.json ├── support │ ├── index.d.ts │ ├── index.js │ └── commands.js ├── integration │ ├── APITests │ │ ├── interceptexp.js │ │ ├── GetUser.js │ │ ├── record.js │ │ ├── DeleteUser.js │ │ ├── weatherapi.js │ │ ├── PostUser.js │ │ └── PutUser.js │ ├── inerception │ │ └── ApiIntercept.js │ └── OauthAPI │ │ └── Oauth2.js ├── plugins │ └── index.js └── index.html ├── package.json └── .gitignore /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "chromeWebSecurity": false, 3 | "baseUrl": "http://coop.apps.symfonycasts.com" 4 | } 5 | -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Test Automation", 3 | "gender":"male", 4 | "email": "nntest@gmail.com", 5 | "status":"active" 6 | } 7 | -------------------------------------------------------------------------------- /cypress/fixtures/createuser.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Test Automation Labs", 3 | "gender":"female", 4 | "email": "nntest@gmail.com", 5 | "status":"active" 6 | } 7 | -------------------------------------------------------------------------------- /cypress/support/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare namespace Cypress { 4 | interface Chainable { 5 | myCustomCommandA(selector: string, option: string): Cypress.Chainable; 6 | myCustomCommandB(param: string, value: any): Cypress.Chainable; 7 | } 8 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cypressapitraining", 3 | "version": "1.0.0", 4 | "description": "this is cypress api practice", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "cypress test" 8 | }, 9 | "author": "Naveen AutomationLabs", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "cypress": "^7.7.0", 13 | "exceljs": "^4.2.1" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cypress/integration/APITests/interceptexp.js: -------------------------------------------------------------------------------- 1 | describe("Search test suite", () => { 2 | it("should search songs", () => { 3 | const authHeader = "Basic MTE5Y2Y4MTI2MWVlNGFjNWI3YjQ5ZTA5M2M4ZmNlNzI6ZWEzZGRlMmMwMDdlNGVkYTliNGFkYTc1M2I0MzViYTM="; 4 | 5 | const options = { 6 | method: "POST", 7 | url: "https://accounts.spotify.com/api/token", 8 | form: true, 9 | body: { 10 | grant_type: "client_credentials" 11 | }, 12 | headers: { 13 | Authorization: authHeader 14 | } 15 | }; 16 | 17 | cy.request(options).then(resp => { 18 | localStorage.setItem("token", resp.body.access_token); 19 | }); 20 | 21 | cy.visit("http://localhost:3000"); 22 | }); 23 | }); -------------------------------------------------------------------------------- /cypress/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | /// 2 | // *********************************************************** 3 | // This example plugins/index.js can be used to load plugins 4 | // 5 | // You can change the location of this file or turn off loading 6 | // the plugins file with the 'pluginsFile' configuration option. 7 | // 8 | // You can read more here: 9 | // https://on.cypress.io/plugins-guide 10 | // *********************************************************** 11 | 12 | // This function is called when a project is opened or re-opened (e.g. due to 13 | // the project's config changing) 14 | 15 | /** 16 | * @type {Cypress.PluginConfig} 17 | */ 18 | // eslint-disable-next-line no-unused-vars 19 | module.exports = (on, config) => { 20 | // `on` is used to hook into various events Cypress emits 21 | // `config` is the resolved Cypress config 22 | } 23 | -------------------------------------------------------------------------------- /cypress/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add('login', (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This will overwrite an existing command -- 25 | // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) 26 | 27 | Cypress.Commands.serialize = (name, email, gender, status) => { 28 | // o = {x:1, y:{z:[false,null,""]}}; 29 | userData = { 30 | name : name, 31 | email: email, 32 | gender: gender, 33 | status: status 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /cypress/integration/APITests/GetUser.js: -------------------------------------------------------------------------------- 1 | /// 2 | const dataJson = require('../../fixtures/example') 3 | describe('api test cases',() => { 4 | var payload = "" 5 | let accesstoken= 'f6d5f728817405850f2f6aff23f8693a6352ca375383a2529e7150a74a9a8de6' 6 | it('get user', () => { 7 | cy.request({ 8 | method : 'GET', 9 | url : 'https://gorest.co.in/public-api/users/123/posts', 10 | headers: { 11 | 'Authorization': 'Bearer '+accesstoken, 12 | } 13 | }).then((res)=>{ 14 | expect(res.status).to.eq(200) 15 | expect(res.body.meta.pagination).has.property('limit',20) 16 | expect(res.body).has.to.deep.equal({ 17 | "code": 200, 18 | "meta": { 19 | "pagination": { 20 | "total": 0, 21 | "pages": 0, 22 | "page": 1, 23 | "limit": 20 24 | } 25 | }, 26 | "data": [] 27 | }) 28 | }) 29 | }) 30 | 31 | it('get user by id', () => { 32 | cy.request({ 33 | method : 'GET', 34 | url : 'https://gorest.co.in/public-api/users/2', 35 | headers: { 36 | 'authorization': 'Bearer '+accesstoken, 37 | } 38 | }).then((res)=>{ 39 | expect(res.status).to.eq(200) 40 | expect(res.body.data.name).to.eq('Aatreya Khanna') 41 | }) 42 | }) 43 | }) -------------------------------------------------------------------------------- /cypress/integration/APITests/record.js: -------------------------------------------------------------------------------- 1 | describe('new record', () => { 2 | 3 | it('test1', ()=>{ 4 | cy.visit('http://automationpractice.com/index.php'); 5 | cy.get('.login').click(); 6 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 7 | cy.get('#email').click(); 8 | cy.get('#email').type('janthird2021batch@gmail.com'); 9 | cy.get('#passwd').type('Selenium12345'); 10 | cy.get('#SubmitLogin > span').click(); 11 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 12 | cy.get('#search_query_top').click(); 13 | cy.get('#search_query_top').type('Dress'); 14 | cy.get('#search_query_top').submit(); 15 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 16 | cy.get('.exclusive > span').click(); 17 | cy.get('.button-medium > span').click(); 18 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 19 | cy.get('.standard-checkout > span').click(); 20 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 21 | cy.get('.button:nth-child(4) > span').click(); 22 | cy.get('form:nth-child(3)').submit(); 23 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 24 | cy.get('.standard-checkout > span').click(); 25 | cy.get('#form').submit(); 26 | cy.get('.fancybox-item').click(); 27 | cy.get('#cgv').click(); 28 | cy.get('.standard-checkout > span').click(); 29 | cy.get('#form').submit(); 30 | cy.url().should('contains', 'http://automationpractice.com/index.php'); 31 | 32 | 33 | 34 | }) 35 | 36 | 37 | 38 | }) 39 | -------------------------------------------------------------------------------- /cypress/integration/inerception/ApiIntercept.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | describe('intercept with cypress examples', ()=>{ 4 | 5 | 6 | 7 | 8 | it('test api with simple intercept stubbing', ()=>{ 9 | 10 | cy.visit('https://jsonplaceholder.typicode.com/') 11 | 12 | cy.intercept({ 13 | path : '/posts' 14 | 15 | }).as('posts') 16 | 17 | cy.get("table:nth-of-type(1) a[href='/posts']").click() 18 | cy.wait('@posts').then(inter =>{ 19 | cy.log(JSON.stringify(inter)) 20 | console.log(JSON.stringify(inter)) 21 | expect(inter.response.body).to.have.length(100) 22 | 23 | }) 24 | 25 | 26 | }) 27 | 28 | 29 | it('mocking with intercept test with static response', ()=>{ 30 | cy.visit('https://jsonplaceholder.typicode.com/') 31 | cy.intercept('GET', '/posts', {totalpost:5 , name: 'naveen'}).as('posts') 32 | cy.get("table:nth-of-type(1) a[href='/posts']").click() 33 | cy.wait('@posts') 34 | }) 35 | 36 | it('mocking with intercept test with dynamic fixture', ()=>{ 37 | cy.visit('https://jsonplaceholder.typicode.com/') 38 | cy.intercept('GET', '/posts', {fixture: 'createuser.json'}).as('posts') 39 | cy.get("table:nth-of-type(1) a[href='/posts']").click() 40 | cy.wait('@posts') 41 | }) 42 | 43 | it.only('mocking with intercept test with dynamic fixture json', ()=>{ 44 | cy.visit('https://jsonplaceholder.typicode.com/') 45 | cy.intercept('GET', '/posts', (req) => { 46 | req.reply((res) =>{ 47 | res.send({fixture: 'createuser.json'}) 48 | }) 49 | 50 | }) 51 | 52 | }) 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | }) -------------------------------------------------------------------------------- /cypress/integration/APITests/DeleteUser.js: -------------------------------------------------------------------------------- 1 | /// 2 | const dataJson = require('../../fixtures/createuser') 3 | 4 | describe('Delete user request', () => { 5 | let accessToken = '007526d9efdbc07e084ff7a6d4cfcc90588fbe20641c00faebf45a7f3b2eaf33' 6 | let randomText = "" 7 | let testEmail = "" 8 | it.only('create user test', () => { 9 | //1. create user (POST) 10 | cy.request({ 11 | method: 'POST', 12 | url: 'https://gorest.co.in/public/v1/users', 13 | headers: { 14 | 'Authorization': 'Bearer ' + accessToken 15 | }, 16 | body: { 17 | "name":"Test Automation Cypress User", 18 | "gender":"male", 19 | "email": "naveenCypressuser@gmail.com", 20 | "status":"active" 21 | } 22 |     23 | }).then((res)=>{ 24 | cy.log(JSON.stringify(res)) 25 | expect(res.status).to.eq(201) 26 | expect(res.body.data).has.property('email', 'naveenCypressuser@gmail.com') 27 | expect(res.body.data).has.property('name','Test Automation Cypress User') 28 | }).then((res) =>{ 29 | const userId = res.body.data.id 30 | cy.log("user id is: " + userId) 31 | //2. delete user (DELETE) 32 | cy.request({ 33 | method: 'DELETE', 34 | url: 'https://gorest.co.in/public/v1/users/'+userId, 35 | headers: { 36 | 'Authorization': 'Bearer ' + accessToken 37 | } 38 | }).then((res)=>{ 39 | expect(res.status).to.eq(204) 40 | }) 41 | }) 42 | 43 | 44 | 45 |   }) 46 | }) -------------------------------------------------------------------------------- /cypress/integration/APITests/weatherapi.js: -------------------------------------------------------------------------------- 1 | describe('check weather informaiton', ()=>{ 2 | 3 | 4 | it('get weather ifnormation for cities', ()=>{ 5 | //1st request: GET locations 6 | cy.request({ 7 | method: 'GET', 8 | url: 'https://www.metaweather.com/api/location/search/?query=San' 9 | 10 | }).then((resp)=>{ 11 | const city = resp.body[0].title 12 | return city 13 | }) 14 | .then((city)=>{ 15 | //2nd request for the first location/city 16 | cy.request({ 17 | method: 'GET', 18 | url: 'https://www.metaweather.com/api/location/search/?query='+city 19 | }).then((resp)=>{ 20 | expect(resp.status).to.eq(200) 21 | expect(resp.body[0]).to.have.property('title', city) 22 | }) 23 | 24 | }) 25 | 26 | }) 27 | 28 | 29 | it.only('get weather information for all cities', ()=>{ 30 | //1st request: GET locations 31 | cy.request({ 32 | method: 'GET', 33 | url: 'https://www.metaweather.com/api/location/search/?query=San' 34 | 35 | }).then((resp)=>{ 36 | const location = resp.body 37 | return location 38 | }) 39 | .then((location)=>{ 40 | 41 | for(let i=0; i< location.length; i++){ 42 | //2nd request for the first location/city 43 | cy.request({ 44 | method: 'GET', 45 | url: 'https://www.metaweather.com/api/location/search/?query='+location[i].title 46 | }).then((resp)=>{ 47 | expect(resp.status).to.eq(200) 48 | expect(resp.body[0]).to.have.property('title', location[i].title) 49 | }) 50 | 51 | } 52 | 53 | }) 54 | 55 | }) 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | }) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port -------------------------------------------------------------------------------- /cypress/integration/APITests/PostUser.js: -------------------------------------------------------------------------------- 1 | /// 2 | const dataJson = require('../../fixtures/createuser') 3 | 4 | describe('post user request', () => { 5 | let accessToken = '007526d9efdbc07e084ff7a6d4cfcc90588fbe20641c00faebf45a7f3b2eaf33' 6 | let randomText = "" 7 | let testEmail = "" 8 | it.only('create user test', () => { 9 | var pattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 10 | for (var i = 0; i < 10; i++) 11 | randomText+=pattern.charAt(Math.floor(Math.random() * pattern.length)); 12 | testEmail = randomText + '@gmail.com' 13 | 14 | cy.fixture('createuser').then((payload) =>{ 15 | 16 | //1. create user (POST) 17 | cy.request({ 18 | method: 'POST', 19 | url: 'https://gorest.co.in/public/v1/users', 20 | headers: { 21 | 'Authorization': 'Bearer ' + accessToken 22 | }, 23 | body: { 24 | "name": payload.name, 25 | "gender": payload.gender, 26 | "email": testEmail, 27 | "status":payload.status 28 | } 29 |     30 | }).then((res)=>{ 31 | cy.log(JSON.stringify(res)) 32 | expect(res.status).to.eq(201) 33 | expect(res.body.data).has.property('email', testEmail) 34 | expect(res.body.data).has.property('name',payload.name) 35 | expect(res.body.data).has.property('status',payload.status) 36 | expect(res.body.data).has.property('gender',payload.gender) 37 | }).then((res) =>{ 38 | const userId = res.body.data.id 39 | cy.log("user id is: " + userId) 40 | //2. get user (GET) 41 | cy.request({ 42 | method: 'GET', 43 | url: 'https://gorest.co.in/public/v1/users/'+userId, 44 | headers: { 45 | 'Authorization': 'Bearer ' + accessToken 46 | } 47 | }).then((res)=>{ 48 | expect(res.status).to.eq(200) 49 | expect(res.body.data).has.property('id', userId) 50 | expect(res.body.data).has.property('name',payload.name) 51 | expect(res.body.data).has.property('status',payload.status) 52 | expect(res.body.data).has.property('email', testEmail) 53 | }) 54 | }) 55 | 56 | 57 | }) 58 |   }) 59 | }) -------------------------------------------------------------------------------- /cypress/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |
12 | 15 |
16 | 19 |
20 | 21 | 22 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /cypress/integration/APITests/PutUser.js: -------------------------------------------------------------------------------- 1 | /// 2 | const dataJson = require('../../fixtures/createuser') 3 | 4 | describe('post user request', () => { 5 | let accessToken = '007526d9efdbc07e084ff7a6d4cfcc90588fbe20641c00faebf45a7f3b2eaf33' 6 | let randomText = "" 7 | let testEmail = "" 8 | 9 | 10 | it.only('create user test', () => { 11 | var pattern = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 12 | for (var i = 0; i < 10; i++) 13 | randomText+=pattern.charAt(Math.floor(Math.random() * pattern.length)); 14 | testEmail = randomText + '@gmail.com' 15 | 16 | //1. create user (POST) 17 | cy.request({ 18 | method: 'POST', 19 | url: 'https://gorest.co.in/public/v1/users', 20 | headers: { 21 | 'Authorization': 'Bearer ' + accessToken 22 | }, 23 | body: { 24 | "name":"Test Automation Cypress", 25 | "gender":"male", 26 | "email": "naveencypress11@gmail.com", 27 | "status":"active" 28 | } 29 |     30 | }).then((res)=>{ 31 | cy.log(JSON.stringify(res)) 32 | expect(res.status).to.eq(201) 33 | expect(res.body.data).has.property('email', 'naveencypress11@gmail.com') 34 | expect(res.body.data).has.property('name','Test Automation Cypress') 35 | expect(res.body.data).has.property('status','active') 36 | expect(res.body.data).has.property('gender','male') 37 | }).then((res) =>{ 38 | const userId = res.body.data.id 39 | cy.log("user id is: " + userId) 40 | //2. update user (PUT) 41 | cy.request({ 42 | method: 'PUT', 43 | url: 'https://gorest.co.in/public/v1/users/'+userId, 44 | headers: { 45 | 'Authorization': 'Bearer ' + accessToken 46 | }, 47 | body: { 48 | "name":"Test Automation Cypress Updated", 49 | "gender":"male", 50 | "email": "naveencypressupdated11@gmail.com", 51 | "status":"inactive" 52 | } 53 | }).then((res)=>{ 54 | expect(res.status).to.eq(200) 55 | expect(res.body.data).has.property('email', 'naveencypressupdated11@gmail.com') 56 | expect(res.body.data).has.property('name','Test Automation Cypress Updated') 57 | expect(res.body.data).has.property('status','inactive') 58 | expect(res.body.data).has.property('gender','male') 59 | }) 60 | }) 61 | 62 | 63 | 64 |   }) 65 | }) -------------------------------------------------------------------------------- /cypress/integration/OauthAPI/Oauth2.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | describe('Oauth feature apis', ()=>{ 4 | let access_token = ''; 5 | let userId = '' 6 | 7 | beforeEach('generate token', ()=>{ 8 | //to get the token id(access token) 9 | cy.request({ 10 | method: 'POST', 11 | url: '/token', 12 | form: true, 13 | body:{ 14 | "client_id" : "CyPressApp", 15 | "client_secret" : "f0590fba402263485300ed0b4612217d", 16 | "grant_type" : "client_credentials" 17 | } 18 | }).then(response=>{ 19 | cy.log(JSON.stringify(response)); 20 | cy.log(response.body.access_token); 21 | access_token = response.body.access_token; 22 | 23 | //get the user id 24 | cy.request({ 25 | method: 'GET', 26 | url: '/api/me', 27 | headers: { 28 | 'Authorization' : 'Bearer ' + access_token 29 | } 30 | }).then(response=>{ 31 | userId = response.body.id; 32 | cy.log("user id " + userId); 33 | }) 34 | }) 35 | }) 36 | it('Unlock the Barn Test', ()=>{ 37 | cy.request({ 38 | method: 'POST', 39 | url: '/api/'+userId+'/barn-unlock', 40 | headers: { 41 | 'Authorization' : 'Bearer ' + access_token 42 | } 43 | }).then(response=>{ 44 | cy.log(JSON.stringify(response)); 45 | expect(response.status).to.equal(200); 46 | }) 47 | }) 48 | 49 | 50 | it('Put the Toilet Seat Down Test', ()=>{ 51 | cy.request({ 52 | method: 'POST', 53 | url: '/api/'+userId+'/toiletseat-down', 54 | headers: { 55 | 'Authorization' : 'Bearer ' + access_token 56 | } 57 | }).then(response=>{ 58 | cy.log(JSON.stringify(response)); 59 | expect(response.status).to.equal(200); 60 | }) 61 | }) 62 | 63 | it('Chicekn Feed Test', ()=>{ 64 | cy.request({ 65 | method: 'POST', 66 | url: '/api/'+userId+'/chickens-feed', 67 | headers: { 68 | 'Authorization' : 'Bearer ' + access_token 69 | } 70 | }).then(response=>{ 71 | cy.log(JSON.stringify(response)); 72 | expect(response.status).to.equal(200); 73 | }) 74 | 75 | }) 76 | 77 | }) 78 | --------------------------------------------------------------------------------