This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pm.test("Validate searchProducts response", () => { | |
| const response = pm.response | |
| response.to.have.status(200) | |
| response.to.have.jsonBody | |
| const data = pm.response.json() | |
| pm.expect(data.statusCode).to.eql(0) | |
| const products = data.searchResults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pm.test("Validate product", () => { | |
| const response = pm.response | |
| response.to.have.status(200) | |
| response.to.have.jsonBody | |
| const data = pm.response.json() | |
| pm.expect(data.statusCode).to.eql(0) | |
| const product = data.product | |
| pm.expect(product.productId).to.not.eql("") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pm.test("Validate addToBasket response", () => { | |
| const response = pm.response | |
| response.to.have.status(200) | |
| response.to.have.jsonBody | |
| const data = pm.response.json() | |
| pm.expect(data.statusCode).to.eql(0) | |
| const products = data.products |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE `retailer-api`.`test-results` ( | |
| Id int(10) unsigned auto_increment NOT NULL, | |
| RetailerId int(10) unsigned NOT NULL, | |
| ApiMethodId int(10) unsigned NOT NULL, | |
| DateAdded datetime NOT NULL, | |
| Passed tinyint(3) NOT NULL, | |
| Error varchar(100) NULL, | |
| CONSTRAINT test_results_PK PRIMARY KEY (Id), | |
| CONSTRAINT test_results_FK FOREIGN KEY (RetailerId) REFERENCES `retailer-api`.retailers(id), | |
| CONSTRAINT test_results_FK_1 FOREIGN KEY (ApiMethodId) REFERENCES `retailer-api`.`api-methods`(id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "take-home-test", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "app.js", | |
| "keywords": [], | |
| "author": "", | |
| "license": "ISC", | |
| "dependencies": { | |
| "axios": "^1.3.3", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require('axios') | |
| const cheerio = require('cheerio') | |
| axios.get('https://cdn.adimo.co/clients/Adimo/test/index.html') | |
| .then(function(response) { | |
| // HTML is inside response.data | |
| let $ = cheerio.load(response.data) | |
| $('div.item').each(function(i, elem){ | |
NewerOlder