Skip to content

Instantly share code, notes, and snippets.

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
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("")
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
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)
@m-jan
m-jan / add_wtb_button_mobile.css
Created April 25, 2023 10:20
Add WTB Button - Mobile CSS
.wtb-button {
font-size: 11px;
}
.fa-map-marker-alt {
font-size: 16px;
color: #008038;
}
@m-jan
m-jan / add_wtb_button_landingPage.css
Created April 25, 2023 09:57
Add WTB Button - Landing Page CSS
/* Change font-family to required font */
.wtb-button {
font-size: 14px;
font-family: "Heineken Bold", sans-serif;
}
.fa-map-marker-alt {
font-size: 20px;
color: #008038;
@m-jan
m-jan / add_wtb_button_landingPage.html
Created April 25, 2023 09:43
Add WTB Button - Landing Page
<script>
/*
BUTTON_HTML should be the text in the button including any icons, e.g
BUTTON_HTML = 'TROVA HEINEKEN VICINO A ME <i class="fal fa-map-marker-alt"></i>'
*/
const BUTTON_HTML = 'TROVA HEINEKEN VICINO A ME <i class="fal fa-map-marker-alt"></i>'
/*
WTB_URL_SLUG should be file path to the wtb campaign, e.g.
WTB url: 'https://campaigns.adimo.co/campaigns/heineken-it-media/wtb/wtb/?touchpointIdentifier=1234-abcd'
WTB_URL_SLUG = '/heineken-it-media/wtb/wtb/'
@m-jan
m-jan / add_wtb_button_mobile.html
Last active April 25, 2023 09:44
Add WTB Button - mobile
</script>
/*
BUTTON_HTML should be the text in the button including any icons, e.g
BUTTON_HTML = 'TROVA HEINEKEN VICINO A ME <i class="fal fa-map-marker-alt"></i>'
*/
const BUTTON_HTML = 'TROVA HEINEKEN VICINO A ME <i class="fal fa-map-marker-alt"></i>'
/*
WTB_URL_SLUG should be file path to the wtb campaign, e.g.
WTB url: 'https://campaigns.adimo.co/campaigns/heineken-it-media/wtb/wtb/?touchpointIdentifier=1234-abcd'
WTB_URL_SLUG = '/heineken-it-media/wtb/wtb/'
@m-jan
m-jan / package.json
Created February 14, 2023 16:39
Take home test package.json
{
"name": "take-home-test",
"version": "1.0.0",
"description": "",
"main": "app.js",
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^1.3.3",
@m-jan
m-jan / app.js
Last active February 14, 2023 16:59
Take home test template
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){