Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script src="index.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
let productList = [
{
productName: `Infinix Hot 30i 6.6'" HD+, 4+4GB RAM /128GB ROM Android 12`,
imageUrl:
"https://ng.jumia.is/unsafe/fit-in/680x680/filters:fill(white)/product/94/9940072/1.jpg?3711",
productPrice: "#97,335",
},
{
productName: `Tecno Spark 10c 6.6" 4GB RAM/128GB ROM Android 13 Black`,
imageUrl:
"https://ng.jumia.is/unsafe/fit-in/680x680/filters:fill(white)/product/16/2938922/1.jpg?5082",
productPrice: "#94,900",
},
{
productName: `Oraimo 20,000MAH Type C & USB Port Powerbank
`,
imageUrl:
"https://ng.jumia.is/unsafe/fit-in/680x680/filters:fill(white)/product/25/314467/1.jpg?9409",
productPrice: "#16,800",
},
];

for (i = 0; i < productList.length; i++) {
const string = `${productList[i].productName} with ${productList[i].imageUrl} is sold for ${productList[i].productPrice} </br>`;
// console.log(string);
document.write(string);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script src="index.js"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
let possitiveDifference = 123 - 7;
for (let i = 1; i <= possitiveDifference; i++) {
// Check if the number is a multiple of 3
if (i % 3 === 0) {
document.write("Software");
document.write("</br>");

// Check if the number is a multiple of 5
} else if (i % 5 === 0) {
document.write("Developer");
document.write("</br>");

// Check if the number is a multiple of 3 and 5
} else if (i % 3 === 0 && i % 5 === 0) {
document.write("Software Developer");
} else {
document.write(i);
document.write("</br>");
}
}
2 changes: 1 addition & 1 deletion tests/logfile.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!doctype html>
<html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Mochawesome Report</title><link rel="stylesheet" href="assets\app.css"/></head><body data-raw="{&quot;stats&quot;:{&quot;suites&quot;:1,&quot;tests&quot;:1,&quot;passes&quot;:1,&quot;pending&quot;:0,&quot;failures&quot;:0,&quot;start&quot;:&quot;2023-12-20T19:54:45.994Z&quot;,&quot;end&quot;:&quot;2023-12-20T19:54:47.738Z&quot;,&quot;duration&quot;:1744,&quot;testsRegistered&quot;:1,&quot;passPercent&quot;:100,&quot;pendingPercent&quot;:0,&quot;other&quot;:0,&quot;hasOther&quot;:false,&quot;skipped&quot;:0,&quot;hasSkipped&quot;:false},&quot;results&quot;:[{&quot;uuid&quot;:&quot;b5f52efb-a1e6-4147-ac5b-50ba769e9d9f&quot;,&quot;title&quot;:&quot;&quot;,&quot;fullFile&quot;:&quot;C:\\Users\\Administrator\\Dufuna-CodeCamp-21\\tests\\add_navigation_links\\navigation_tasks.js&quot;,&quot;file&quot;:&quot;\\navigation_tasks.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[],&quot;suites&quot;:[{&quot;uuid&quot;:&quot;a229b6cc-88d6-4e16-9b23-5943cd4e1576&quot;,&quot;title&quot;:&quot;Testing Navigation on HtmlForms&quot;,&quot;fullFile&quot;:&quot;C:\\Users\\Administrator\\Dufuna-CodeCamp-21\\tests\\add_navigation_links\\navigation_tasks.js&quot;,&quot;file&quot;:&quot;\\navigation_tasks.js&quot;,&quot;beforeHooks&quot;:[{&quot;title&quot;:&quot;\&quot;before all\&quot; hook: setupWebdriver in \&quot;Testing Navigation on HtmlForms\&quot;&quot;,&quot;fullTitle&quot;:&quot;Testing Navigation on HtmlForms \&quot;before all\&quot; hook: setupWebdriver in \&quot;Testing Navigation on HtmlForms\&quot;&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:1675,&quot;pass&quot;:false,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;var file_url = `file://${file_path}`;\ndriver.get(file_url).then(done)&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;c8886dd9-06ec-415e-b915-a3c16845c04f&quot;,&quot;parentUUID&quot;:&quot;a229b6cc-88d6-4e16-9b23-5943cd4e1576&quot;,&quot;isHook&quot;:true,&quot;skipped&quot;:false}],&quot;afterHooks&quot;:[{&quot;title&quot;:&quot;\&quot;after all\&quot; hook in \&quot;Testing Navigation on HtmlForms\&quot;&quot;,&quot;fullTitle&quot;:&quot;Testing Navigation on HtmlForms \&quot;after all\&quot; hook in \&quot;Testing Navigation on HtmlForms\&quot;&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:0,&quot;pass&quot;:false,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;driver.quit()&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;55b78ce4-0a83-454e-92c7-792dcc4ab2c5&quot;,&quot;parentUUID&quot;:&quot;a229b6cc-88d6-4e16-9b23-5943cd4e1576&quot;,&quot;isHook&quot;:true,&quot;skipped&quot;:false}],&quot;tests&quot;:[{&quot;title&quot;:&quot;test case: assert that there are 2 links on this page&quot;,&quot;fullTitle&quot;:&quot;Testing Navigation on HtmlForms test case: assert that there are 2 links on this page&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:57,&quot;state&quot;:&quot;passed&quot;,&quot;speed&quot;:&quot;medium&quot;,&quot;pass&quot;:true,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;const links = await driver.findElements(By.css(&#x27;a&#x27;));\nconst size = links.length;\nassert.equal(size, 2, `Ensure you have two links on this page`);&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;f352da5c-d16a-40bf-a89c-51b3ec731c9a&quot;,&quot;parentUUID&quot;:&quot;a229b6cc-88d6-4e16-9b23-5943cd4e1576&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:false}],&quot;suites&quot;:[],&quot;passes&quot;:[&quot;f352da5c-d16a-40bf-a89c-51b3ec731c9a&quot;],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:57,&quot;root&quot;:false,&quot;rootEmpty&quot;:false,&quot;_timeout&quot;:180000}],&quot;passes&quot;:[],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:0,&quot;root&quot;:true,&quot;rootEmpty&quot;:true,&quot;_timeout&quot;:2000}],&quot;meta&quot;:{&quot;mocha&quot;:{&quot;version&quot;:&quot;10.2.0&quot;},&quot;mochawesome&quot;:{&quot;options&quot;:{&quot;quiet&quot;:true,&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;saveHtml&quot;:true,&quot;saveJson&quot;:true,&quot;consoleReporter&quot;:&quot;spec&quot;,&quot;useInlineDiffs&quot;:false,&quot;code&quot;:true},&quot;version&quot;:&quot;7.1.3&quot;},&quot;marge&quot;:{&quot;options&quot;:{&quot;reportDir&quot;:&quot;C:/Users/Administrator/Dufuna-CodeCamp-21/tests/add_navigation_links/../..//tests/&quot;,&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;quiet&quot;:&quot;true&quot;},&quot;version&quot;:&quot;6.2.0&quot;}}}" data-config="{&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;reportDir&quot;:&quot;C:/Users/Administrator/Dufuna-CodeCamp-21/tests/add_navigation_links/../..//tests/&quot;,&quot;reportTitle&quot;:&quot;add_navigation_links&quot;,&quot;reportPageTitle&quot;:&quot;Mochawesome Report&quot;,&quot;inline&quot;:false,&quot;inlineAssets&quot;:false,&quot;cdn&quot;:false,&quot;charts&quot;:false,&quot;enableCharts&quot;:false,&quot;code&quot;:true,&quot;enableCode&quot;:true,&quot;autoOpen&quot;:false,&quot;overwrite&quot;:true,&quot;timestamp&quot;:false,&quot;ts&quot;:false,&quot;showPassed&quot;:true,&quot;showFailed&quot;:true,&quot;showPending&quot;:true,&quot;showSkipped&quot;:false,&quot;showHooks&quot;:&quot;failed&quot;,&quot;saveJson&quot;:true,&quot;saveHtml&quot;:true,&quot;dev&quot;:false,&quot;assetsDir&quot;:&quot;C:\\Users\\Administrator\\Dufuna-CodeCamp-21\\tests\\assets&quot;,&quot;jsonFile&quot;:&quot;C:\\Users\\Administrator\\Dufuna-CodeCamp-21\\tests\\logfile.json&quot;,&quot;htmlFile&quot;:&quot;C:\\Users\\Administrator\\Dufuna-CodeCamp-21\\tests\\logfile.html&quot;}"><div id="report"></div><script src="assets\app.js"></script></body></html>
<html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Mochawesome Report</title><link rel="stylesheet" href="assets\app.css"/></head><body data-raw="{&quot;stats&quot;:{&quot;suites&quot;:1,&quot;tests&quot;:0,&quot;passes&quot;:0,&quot;pending&quot;:0,&quot;failures&quot;:0,&quot;start&quot;:&quot;2024-01-14T09:44:57.665Z&quot;,&quot;end&quot;:&quot;2024-01-14T09:47:57.710Z&quot;,&quot;duration&quot;:180045,&quot;testsRegistered&quot;:2,&quot;passPercent&quot;:0,&quot;pendingPercent&quot;:0,&quot;other&quot;:1,&quot;hasOther&quot;:true,&quot;skipped&quot;:2,&quot;hasSkipped&quot;:true},&quot;results&quot;:[{&quot;uuid&quot;:&quot;0ce0cc6b-4bd7-4c42-aec9-f15dbbb9857d&quot;,&quot;title&quot;:&quot;&quot;,&quot;fullFile&quot;:&quot;C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\product_price_printing\\test.js&quot;,&quot;file&quot;:&quot;\\test.js&quot;,&quot;beforeHooks&quot;:[],&quot;afterHooks&quot;:[],&quot;tests&quot;:[],&quot;suites&quot;:[{&quot;uuid&quot;:&quot;6101d7dd-aafe-44ff-b061-ddc48af5cce6&quot;,&quot;title&quot;:&quot;Printing product price&quot;,&quot;fullFile&quot;:&quot;C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\product_price_printing\\test.js&quot;,&quot;file&quot;:&quot;\\test.js&quot;,&quot;beforeHooks&quot;:[{&quot;title&quot;:&quot;\&quot;before all\&quot; hook: setupWebdriver for \&quot;test case: check product details\&quot;&quot;,&quot;fullTitle&quot;:&quot;Printing product price \&quot;before all\&quot; hook: setupWebdriver for \&quot;test case: check product details\&quot;&quot;,&quot;timedOut&quot;:true,&quot;duration&quot;:180020,&quot;state&quot;:&quot;failed&quot;,&quot;pass&quot;:false,&quot;fail&quot;:true,&quot;pending&quot;:false,&quot;code&quot;:&quot;const file_url = `file://${file_path}`;\ndriver.get(file_url).then(done);&quot;,&quot;err&quot;:{&quot;message&quot;:&quot;Error: Timeout of 180000ms exceeded. For async tests and hooks, ensure \&quot;done()\&quot; is called; if returning a Promise, ensure it resolves. (C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\product_price_printing\\test.js)&quot;,&quot;estack&quot;:&quot;Error: Timeout of 180000ms exceeded. For async tests and hooks, ensure \&quot;done()\&quot; is called; if returning a Promise, ensure it resolves. (C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\product_price_printing\\test.js)\n at listOnTimeout (internal/timers.js:557:17)\n at processTimers (internal/timers.js:500:7)&quot;},&quot;uuid&quot;:&quot;c6cf3649-7c71-4653-a868-25b0448056fb&quot;,&quot;parentUUID&quot;:&quot;6101d7dd-aafe-44ff-b061-ddc48af5cce6&quot;,&quot;isHook&quot;:true,&quot;skipped&quot;:false}],&quot;afterHooks&quot;:[{&quot;title&quot;:&quot;\&quot;after all\&quot; hook in \&quot;Printing product price\&quot;&quot;,&quot;fullTitle&quot;:&quot;Printing product price \&quot;after all\&quot; hook in \&quot;Printing product price\&quot;&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:1,&quot;pass&quot;:false,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;driver.quit();&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;44dcbef6-e1a3-4b72-96a1-1ad7fad2115f&quot;,&quot;parentUUID&quot;:&quot;6101d7dd-aafe-44ff-b061-ddc48af5cce6&quot;,&quot;isHook&quot;:true,&quot;skipped&quot;:false}],&quot;tests&quot;:[{&quot;title&quot;:&quot;test case: check product details&quot;,&quot;fullTitle&quot;:&quot;Printing product price test case: check product details&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:0,&quot;pass&quot;:false,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;const element = await driver.findElement(By.css(\&quot;body\&quot;));\nconst text = await element.getText();\nassert.include(\n text,\n \&quot;is sold for\&quot;,\n \&quot;Ensure you print out the value in the right format\&quot;\n);&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;09308354-53b8-4ac5-b318-d79e85b78395&quot;,&quot;parentUUID&quot;:&quot;6101d7dd-aafe-44ff-b061-ddc48af5cce6&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:true},{&quot;title&quot;:&quot;test case: check three arrays are present&quot;,&quot;fullTitle&quot;:&quot;Printing product price test case: check three arrays are present&quot;,&quot;timedOut&quot;:false,&quot;duration&quot;:0,&quot;pass&quot;:false,&quot;fail&quot;:false,&quot;pending&quot;:false,&quot;code&quot;:&quot;const element = await driver.findElement(By.css(\&quot;body\&quot;));\nconst text = await element.getText();\nconst count = text.split(\&quot;is sold for\&quot;).length - 1;\nassert.equal(count, 3, \&quot;Ensure the array contains 3 objects\&quot;);&quot;,&quot;err&quot;:{},&quot;uuid&quot;:&quot;8677ee8f-390d-4815-a1b0-b1b989ce5bd5&quot;,&quot;parentUUID&quot;:&quot;6101d7dd-aafe-44ff-b061-ddc48af5cce6&quot;,&quot;isHook&quot;:false,&quot;skipped&quot;:true}],&quot;suites&quot;:[],&quot;passes&quot;:[],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[&quot;09308354-53b8-4ac5-b318-d79e85b78395&quot;,&quot;8677ee8f-390d-4815-a1b0-b1b989ce5bd5&quot;],&quot;duration&quot;:0,&quot;root&quot;:false,&quot;rootEmpty&quot;:false,&quot;_timeout&quot;:180000}],&quot;passes&quot;:[],&quot;failures&quot;:[],&quot;pending&quot;:[],&quot;skipped&quot;:[],&quot;duration&quot;:0,&quot;root&quot;:true,&quot;rootEmpty&quot;:true,&quot;_timeout&quot;:2000}],&quot;meta&quot;:{&quot;mocha&quot;:{&quot;version&quot;:&quot;10.2.0&quot;},&quot;mochawesome&quot;:{&quot;options&quot;:{&quot;quiet&quot;:true,&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;saveHtml&quot;:true,&quot;saveJson&quot;:true,&quot;consoleReporter&quot;:&quot;spec&quot;,&quot;useInlineDiffs&quot;:false,&quot;code&quot;:true},&quot;version&quot;:&quot;7.1.3&quot;},&quot;marge&quot;:{&quot;options&quot;:{&quot;reportDir&quot;:&quot;C:/Users/User/Desktop/Dufuna-CodeCamp-21/tests/product_price_printing/../..//tests/&quot;,&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;quiet&quot;:&quot;true&quot;},&quot;version&quot;:&quot;6.2.0&quot;}}}" data-config="{&quot;reportFilename&quot;:&quot;logfile&quot;,&quot;reportDir&quot;:&quot;C:/Users/User/Desktop/Dufuna-CodeCamp-21/tests/product_price_printing/../..//tests/&quot;,&quot;reportTitle&quot;:&quot;product_price_printing&quot;,&quot;reportPageTitle&quot;:&quot;Mochawesome Report&quot;,&quot;inline&quot;:false,&quot;inlineAssets&quot;:false,&quot;cdn&quot;:false,&quot;charts&quot;:false,&quot;enableCharts&quot;:false,&quot;code&quot;:true,&quot;enableCode&quot;:true,&quot;autoOpen&quot;:false,&quot;overwrite&quot;:true,&quot;timestamp&quot;:false,&quot;ts&quot;:false,&quot;showPassed&quot;:true,&quot;showFailed&quot;:true,&quot;showPending&quot;:true,&quot;showSkipped&quot;:false,&quot;showHooks&quot;:&quot;failed&quot;,&quot;saveJson&quot;:true,&quot;saveHtml&quot;:true,&quot;dev&quot;:false,&quot;assetsDir&quot;:&quot;C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\assets&quot;,&quot;jsonFile&quot;:&quot;C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\logfile.json&quot;,&quot;htmlFile&quot;:&quot;C:\\Users\\User\\Desktop\\Dufuna-CodeCamp-21\\tests\\logfile.html&quot;}"><div id="report"></div><script src="assets\app.js"></script></body></html>
Loading