webship-js 1.0.2 → 1.0.4-1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.circleci/config.yml +110 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.json +34 -0
  4. package/.github/workflows/github-actions.yml +52 -17
  5. package/.gitlab-ci.yml +48 -26
  6. package/.travis-ci.yml +27 -0
  7. package/CNAME +1 -0
  8. package/README.md +25 -5
  9. package/assets/config_templates/circleci-linux-chrome.conf.js +118 -0
  10. package/assets/config_templates/github-linux-chrome.conf.js +124 -0
  11. package/bitbucket-pipelines.yml +26 -0
  12. package/examples/about-us.html +11 -0
  13. package/examples/contact-us.html +10 -0
  14. package/examples/example-api.json +28 -0
  15. package/examples/existing-page.html +11 -0
  16. package/examples/index.html +31 -0
  17. package/examples/main.js +17 -0
  18. package/examples/test--then--i-should--not--see-text-in-element.html +48 -0
  19. package/examples/test--then--i-should--see-text-in-element.html +48 -0
  20. package/examples/test--then--i-should--see-text-matching-pattern.html +31 -0
  21. package/examples/test--then--the-checkbox-checked.html +68 -0
  22. package/examples/test--then--the-element-should_not-contain-cssproperty.html +47 -0
  23. package/examples/test--then--the-link-should-contain.html +21 -0
  24. package/examples/test--when--i-attach-file-to-feild.html +50 -0
  25. package/examples/test--when--i-check-uncheck-checkbox.html +47 -0
  26. package/examples/test--when--i-click-link.html +18 -0
  27. package/examples/test--when--i-fill-in.html +48 -0
  28. package/examples/test--when--i-press-button.html +31 -0
  29. package/examples/test--when--i-reload-page.html +27 -0
  30. package/examples/test--when--i-scroll-functionality.html +176 -0
  31. package/examples/test--when--i-select-option-from-dropdownlist.html +35 -0
  32. package/examples/test--when-i-wait-max-of-time.html +39 -0
  33. package/examples/test--when-i-wait-page-until-is-loaded.html +47 -0
  34. package/examples/test--when-i-wait-specific-time.html +39 -0
  35. package/examples/test-acceptable-url-path.html +11 -0
  36. package/generate-reports.js +22 -0
  37. package/lib/custom-assertions/checkboxChecked.js +87 -0
  38. package/lib/custom-assertions/elementContainsCss.js +94 -0
  39. package/lib/custom-assertions/elementContainsText.js +86 -0
  40. package/lib/custom-assertions/responseStatus.js +31 -0
  41. package/lib/custom-assertions/shouldVisible.js +8 -0
  42. package/lib/custom-assertions/textMatching.js +44 -0
  43. package/lib/custom-commands/checkItem.js +4 -0
  44. package/lib/custom-commands/clickLink.js +23 -0
  45. package/lib/custom-commands/fileUpload.js +37 -0
  46. package/lib/custom-commands/fillTextInput.js +56 -0
  47. package/lib/custom-commands/press.js +3 -0
  48. package/lib/custom-commands/selectOption.js +11 -0
  49. package/lib/custom-commands/uncheckItem.js +4 -0
  50. package/lib/custom-commands/wait.js +12 -0
  51. package/nightwatch.conf.js +71 -287
  52. package/package.json +27 -6
  53. package/src/index.js +10 -0
  54. package/steplist.js +245 -0
  55. package/tests/assets/webshipco.png +0 -0
  56. package/tests/features/test--given--i-am-on-homepage.feature +16 -0
  57. package/tests/features/test--then--i-should--not--see-text-in-element.feature +13 -0
  58. package/tests/features/test--then--i-should--see-text-in-element-by-attr.feature +10 -0
  59. package/tests/features/test--then--i-should--see-text-in-element.feature +10 -0
  60. package/tests/features/test--then--i-should--see-text-matching-pattern-in-element.feature +13 -0
  61. package/tests/features/test--then--i-should--see-text-matching-pattern.feature +18 -0
  62. package/tests/features/test--then--i-should-be-on-page.feature +10 -0
  63. package/tests/features/test--then--i-should-be-on-the-homepage.feature +10 -0
  64. package/tests/features/test--then--i-should-not-see-an-element-by-attr.feature +8 -0
  65. package/tests/features/test--then--i-should-not-see-an-element.feature +8 -0
  66. package/tests/features/test--then--i-should-see-an-element-by-attr.feature +8 -0
  67. package/tests/features/test--then--i-should-see-an-element.feature +8 -0
  68. package/tests/features/test--then--the-checkbox-is-checked.feature +18 -0
  69. package/tests/features/test--then--the-checkbox-should-be-checked.feature +16 -0
  70. package/tests/features/test--then--the-element-should-contain-cssproperty.feature +9 -0
  71. package/tests/features/test--then--the-element-should-not-contain-cssproperty.feature +10 -0
  72. package/tests/features/test--then--the-field-should-contain-value.feature +11 -0
  73. package/tests/features/test--then--the-response-should-contain.feature +11 -0
  74. package/tests/features/test--then--the-response-status-code-should-be.feature +31 -0
  75. package/tests/features/test--then--the-url-should-match.feature +7 -0
  76. package/tests/features/test--then-the-link-should-contain-by-attribute.feature +18 -0
  77. package/tests/features/test--then-the-link-should-contain.feature +7 -0
  78. package/tests/features/test--when--i-attach-file-to-feild.feature +9 -0
  79. package/tests/features/test--when--i-check-checkbox.feature +21 -0
  80. package/tests/features/test--when--i-click-link-by-attribute.feature +21 -0
  81. package/tests/features/test--when--i-click-link.feature +9 -0
  82. package/tests/features/test--when--i-fill-in-by-attr.feature +31 -0
  83. package/tests/features/test--when--i-fill-in-table-by-attr.feature +19 -0
  84. package/tests/features/test--when--i-fill-in.feature +32 -0
  85. package/tests/features/test--when--i-go-to-homepage.feature +9 -0
  86. package/tests/features/test--when--i-move-forward-backward-one-page.feature +14 -0
  87. package/tests/features/test--when--i-press-button-by-attribute.feature +18 -0
  88. package/tests/features/test--when--i-press-button.feature +13 -0
  89. package/tests/features/test--when--i-reload-page.feature +11 -0
  90. package/tests/features/test--when--i-scroll.feature +48 -0
  91. package/tests/features/test--when--i-select-option-from-dropdownlist.feature +21 -0
  92. package/tests/features/test--when--i-wait-page-is-loaded.feature +8 -0
  93. package/tests/features/test--when--i-wait-time.feature +21 -0
  94. package/tests/step-definitions/webship.js +1363 -9
  95. package/webpack.config.js +17 -0
  96. package/webship-init.js +75 -0
  97. package/tests/features/check-webshipco-site.feature +0 -8
@@ -0,0 +1,28 @@
1
+ {
2
+ "data": [{
3
+ "type": "articles",
4
+ "id": "1",
5
+ "attributes": {
6
+ "title": "JSON:API paints my bikeshed!",
7
+ "body": "The shortest article. Ever.",
8
+ "created": "2015-05-22T14:56:29.000Z",
9
+ "updated": "2015-05-22T14:56:28.000Z"
10
+ },
11
+ "relationships": {
12
+ "author": {
13
+ "data": {"id": "42", "type": "people"}
14
+ }
15
+ }
16
+ }],
17
+ "included": [
18
+ {
19
+ "type": "people",
20
+ "id": "42",
21
+ "attributes": {
22
+ "name": "John",
23
+ "age": 80,
24
+ "gender": "male"
25
+ }
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Existing Page</title>
6
+ </head>
7
+ <body>
8
+ <h1>Existing Page</h1>
9
+ <p>An example page that returns a 200 response code</p>
10
+ </body>
11
+ </html>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <title>Webship-js Examples</title>
6
+ <style>
7
+ a:link{font-size: 30px; text-decoration: none;}
8
+ a:active {color: blue;}
9
+ a:visited {color: blue;}
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <h1>Step Definitions Examples:</h1>
14
+ <h3>Welcome to the homepage of the Webship-js Examples</h3>
15
+ <ul>
16
+ <li><a href="/">Given I go to homepage</a></li>
17
+ <li><a href="about-us.html">About Us</a></li>
18
+ <li><a href="test--when--i-press-button.html">When I press "Button"</a></li>
19
+ <li><a href="test--when--i-reload-page.html">When I go reload page</a></li>
20
+ <li><a href="test--when--i-click-link.html">When I click "link"</a></li>
21
+ <li><a href="test--when--i-fill-in.html">When I fill in input text with value</a></li>
22
+ <li><a href="test--when--i-select-option-from-dropdownlist.html">When I select option from select box</a></li>
23
+ <li><a href="test--then--i-should--not--see-text-in-element.html">Then I sould (not) see test in element</a></li>
24
+ <li><a href="test--then--the-element-should_not-contain-cssproperty.html">Then the element should (not) contain css property</a></li>
25
+ <li><a href="test--then--the-checkbox-checked.html">Then the checkbox (is/should be) (not) checked</a></li>
26
+ <li><a href="test--when-i-wait-specific-time.html">When I Wait a specific Time</a></li>
27
+ <li><a href="test--when-i-wait-max-of-time.html">When I Wait a Maximum of Time</a></li>
28
+ </ul>
29
+ <script src="main.js"></script>
30
+ </body>
31
+ </html>
@@ -0,0 +1,17 @@
1
+ /*
2
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3
+ * This devtool is not neither made for production nor for readable output files.
4
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
5
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6
+ * or disable the default devtool with "devtool: false".
7
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8
+ */
9
+ /******/ (() => { // webpackBootstrap
10
+ /*!**********************!*\
11
+ !*** ./src/index.js ***!
12
+ \**********************/
13
+ /*! unknown exports (runtime-defined) */
14
+ /*! runtime requirements: */
15
+ eval("function component() {\n const element = document.createElement('div');\n\n //Lodash, now imported by this script\n element.innerHTML = _.join(['Hello', 'webpack'], ' ');\n\n return element;\n}\n\ndocument.body.appendChild(component());\n\n//# sourceURL=webpack://webship-js/./src/index.js?");
16
+ /******/ })()
17
+ ;
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .container,
8
+ .container input,
9
+ .container button{
10
+ font-size: 26px;
11
+ }
12
+ .style{
13
+ width: 400px;
14
+ height: 50px;
15
+ font-size: 18px;
16
+ line-height: 50px;
17
+ text-align: center;
18
+ }
19
+ </style>
20
+
21
+ <script>
22
+ function onClick(){
23
+ const username = document.getElementById("uname");
24
+ const password = document.getElementById("pword");
25
+ const element = document.getElementById("result");
26
+ element.innerText = "You enter Username: " + username.value + " and Password: " + password.value;
27
+ }
28
+ </script>
29
+
30
+ </head>
31
+ <body>
32
+ <h1>Login</h1>
33
+
34
+ <div class="container">
35
+ <p><label for="uname">Username</label></p>
36
+ <p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
37
+
38
+ <p><label for="pword">Password</label></p>
39
+ <p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
40
+
41
+ <p><input id="reset" type="reset" value="Reset" /><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()" /></p>
42
+
43
+ </div>
44
+
45
+ <div id="result" class="style"></div><br/>
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .container,
8
+ .container input,
9
+ .container button{
10
+ font-size: 26px;
11
+ }
12
+ .style{
13
+ width: 400px;
14
+ height: 50px;
15
+ font-size: 18px;
16
+ line-height: 50px;
17
+ text-align: center;
18
+ }
19
+ </style>
20
+
21
+ <script>
22
+ function onClick(){
23
+ const username = document.getElementById("uname");
24
+ const password = document.getElementById("pword");
25
+ const element = document.getElementById("result");
26
+ element.innerText = "You enter Username: " + username.value + " and Password: " + password.value;
27
+ }
28
+ </script>
29
+
30
+ </head>
31
+ <body>
32
+ <h1>Login</h1>
33
+
34
+ <div class="container">
35
+ <p><label for="uname">Username</label></p>
36
+ <p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
37
+
38
+ <p><label for="pword">Password</label></p>
39
+ <p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
40
+
41
+ <p><input id="reset" type="reset" value="Reset" /><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()" /></p>
42
+
43
+ </div>
44
+
45
+ <div id="result" class="style"></div><br/>
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset='utf-8'>
6
+ <title>Text Matching Pattern</title>
7
+ <style>
8
+ .container,
9
+ .container input,
10
+ .container button {
11
+ font-size: 26px;
12
+ }
13
+ </style>
14
+
15
+ </head>
16
+
17
+ <body>
18
+ <h1>Text Matching Pattern</h1>
19
+
20
+ <div class="container">
21
+ <p>Email:</p><p>info@webship.co</p>
22
+ <p>Telephone:</p><p>0796-778899</p>
23
+ <p>Password conditions:</p><p>Pa$$word2023</p>
24
+ <div class="time"><p>Time:</p><p>10:30 AM</p></div>
25
+ <div id="date"><p>Date (Number):</p><p>22-03-2023</p></div>
26
+ <div id="countryCode"><p>Country code:</p><p id="ccode">JOR</p></div>
27
+ </div>
28
+
29
+ </body>
30
+
31
+ </html>
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset='utf-8'>
6
+ <title>Item should be checked</title>
7
+ <style>
8
+ .container,
9
+ .container input,
10
+ .container button {
11
+ font-size: 22px;
12
+ }
13
+
14
+ .style {
15
+ width: 400px;
16
+ height: 50px;
17
+ font-size: 22px;
18
+ line-height: 50px;
19
+ text-align: center;
20
+ }
21
+ </style>
22
+
23
+ <script>
24
+ function onClick() {
25
+ const element = document.getElementById("result");
26
+ const PrivacyPolicy = document.getElementById("PrivacyPolicy");
27
+ if (PrivacyPolicy.checked) {
28
+ element.innerText = "Registration Done Successfully";
29
+ } else {
30
+ element.innerText = "Please check Agree to Privacy Policy";
31
+ }
32
+
33
+ }
34
+ </script>
35
+
36
+ </head>
37
+
38
+ <body>
39
+ <h1>Registration</h1>
40
+
41
+ <div class="container">
42
+ <p>
43
+ <label for="email">Email</label><br/>
44
+ <input type="text" placeholder="Enter Email" name="email" id="email" required>
45
+ </p>
46
+ <p>
47
+ <label for="psw">Password</label><br/>
48
+ <input type="password" placeholder="Enter Password" name="psw" id="psw" required>
49
+ </p>
50
+ <p>
51
+ <label for="psw-repeat">Repeat Password</label><br/>
52
+ <input type="password" placeholder="Repeat Password" name="psw-repeat" id="psw-repeat" required>
53
+ </p>
54
+ <hr>
55
+
56
+ <p><input type="checkbox" value="lsRememberMe" id="rememberMe" name="rememberMe"> <label for="rememberMe">Remember me</label></p>
57
+ <p><input type="checkbox" value="lsPrivacyPolicy" id="PrivacyPolicy" name="PrivacyPolicy"> <label for="PrivacyPolicy">I Agree to Privacy Policy</label></p>
58
+
59
+ <p><input id="registerbtn" class="registerbtn" name="registerbtn" type="button" value="Register"
60
+ onclick="onClick()"></p>
61
+
62
+ </div>
63
+
64
+ <div id="result" class="style"></div><br />
65
+
66
+ </body>
67
+
68
+ </html>
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .container,
8
+ .container input,
9
+ .container button{
10
+ font-size: 26px;
11
+ }
12
+ body{
13
+ background-color: lightcoral;
14
+ }
15
+ .unamecss{
16
+ border: solid 5px red;
17
+ }
18
+
19
+ </style>
20
+
21
+ <script>
22
+ function onClick(){
23
+ const username = document.getElementById("uname");
24
+ username.style.borderColor = "green";
25
+ document.body.style.backgroundColor = "white";
26
+ }
27
+ </script>
28
+
29
+ </head>
30
+ <body>
31
+ <h1>Login</h1>
32
+
33
+ <div class="container">
34
+ <p><label for="uname">Username</label></p>
35
+ <p><input id="uname" class="unamecss" type="text" placeholder="Enter Username" name="username"></p>
36
+
37
+ <p><label for="pword">Password</label></p>
38
+ <p><input id="pword" class="pwordcss" type="password" placeholder="Enter Password" name="password"></p>
39
+
40
+ <p><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Submit" onclick="onClick()"></p>
41
+
42
+ </div>
43
+
44
+ <div id="result" class="style"></div><br/>
45
+
46
+ </body>
47
+ </html>
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Click Link</title>
6
+ <style>
7
+ .style {
8
+ font-size: 26px;
9
+ }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <h1>Click Link</h1>
14
+ <div id="result" class="style">
15
+ <ul>
16
+ <li><a id="aboutUsid" class="aboutUs" title="aboutUsTitle" href="about-us.html">About us</a></li>
17
+ <li><a id="contactUsid" class="contactUs" href="contact-us.html">Contact us</a></li>
18
+ </ul>
19
+ </div>
20
+ </body>
21
+ </html>
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset='utf-8'>
6
+ <title>Press Button</title>
7
+ <style>
8
+ .style {
9
+ font-size: 26px;
10
+ }
11
+ </style>
12
+ <script>
13
+ function onClick() {
14
+ const imageUpload = document.getElementById("fileUpload");
15
+ const element = document.getElementById("result");
16
+ const filePathArr = imageUpload.value.split('\\');
17
+ element.innerText = filePathArr[filePathArr.length - 1];
18
+
19
+ const file = imageUpload.files[0];
20
+
21
+ // Create a FileReader object
22
+ const reader = new FileReader();
23
+
24
+ // Set up the reader's onload event handler
25
+ reader.onload = function(e) {
26
+ // Get the image data URL
27
+ const imageDataUrl = e.target.result;
28
+
29
+ // Display the uploaded image
30
+ const imagePreview = document.getElementById('imagePreview');
31
+ imagePreview.src = imageDataUrl;
32
+ };
33
+
34
+ // Read the selected file as Data URL
35
+ reader.readAsDataURL(file);
36
+
37
+ }
38
+ </script>
39
+ </head>
40
+
41
+ <body>
42
+ <label for="myfile">Select a file:</label>
43
+ <input type="file" id="fileUpload" name="fileUpload"><br><br>
44
+ <img id="imagePreview" src="#" width="150" height="150" />
45
+ <div id="result" class="style"></div><br />
46
+ <input type="submit" value="Submit" onclick="onClick()">
47
+
48
+ </body>
49
+
50
+ </html>
@@ -0,0 +1,47 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset='utf-8'>
6
+ <title>Check Item</title>
7
+ <style>
8
+ .style {
9
+ height: 50px;
10
+ font-size: 26px;
11
+ line-height: 50px;
12
+ }
13
+ </style>
14
+ <script>
15
+ function onClick() {
16
+ var vehicle = document.forms[0];
17
+ var txt = "";
18
+ var i;
19
+ for (i = 0; i < vehicle.length; i++) {
20
+ if (vehicle[i].checked) {
21
+ txt = txt + vehicle[i].value + " ";
22
+ }
23
+ }
24
+ const element = document.getElementById("result");
25
+ element.innerText = "You have a " + txt;
26
+ }
27
+ </script>
28
+ </head>
29
+
30
+ <body>
31
+ <h1>Check Option</h1>
32
+ <form>
33
+ <input type="checkbox" id="bike" name="bike" value="Bike">
34
+ <label for="vehicle1"> I have a bike</label><br>
35
+ <input type="checkbox" id="car" name="car" value="Car">
36
+ <label for="vehicle2"> I have a car</label><br>
37
+ <input type="checkbox" id="boat" name="boat" value="Boat">
38
+ <label for="vehicle3"> I have a boat</label><br>
39
+ <input type="checkbox" id="van" name="van" value="Van">
40
+ <label for="vehicle4"> I have a van</label><br>
41
+ </form>
42
+
43
+ <input id="btnClick" class="btnClick" name="btnClick" type="button" value="Submit" onclick="onClick()">
44
+ <div id="result" class="style"></div><br />
45
+ </body>
46
+
47
+ </html>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Click Link</title>
6
+ <style>
7
+ .style{
8
+ font-size: 26px;
9
+ }
10
+ </style>
11
+ </head>
12
+ <body>
13
+ <h1>Click Link</h1>
14
+ <div id="result" class="style">
15
+ Please click <a id="aboutUsid" class="aboutUs" href="about-us.html">About us link</a> for more information.
16
+ </div>
17
+ </body>
18
+ </html>
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .container,
8
+ .container input,
9
+ .container button{
10
+ font-size: 26px;
11
+ }
12
+ .style{
13
+ width: 400px;
14
+ height: 50px;
15
+ font-size: 18px;
16
+ line-height: 50px;
17
+ text-align: center;
18
+ }
19
+ </style>
20
+
21
+ <script>
22
+ function onClick(){
23
+ const username = document.getElementById("uname");
24
+ const password = document.getElementById("pword");
25
+ const element = document.getElementById("result");
26
+ element.innerText = "You enter Username: " + username.value + " and Password: " + password.value;
27
+ }
28
+ </script>
29
+
30
+ </head>
31
+ <body>
32
+ <h1>Login</h1>
33
+
34
+ <div class="container">
35
+ <p><label for="uname">Username</label></p>
36
+ <p><input id="uname" class="unamecss" type="text" placeholder="Your full name" name="username"></p>
37
+
38
+ <p><label for="pword">Password</label></p>
39
+ <p><input id="pword" class="pwordcss" type="password" placeholder="Your Password" name="password"></p>
40
+
41
+ <p><input id="btnLogin" class="btnLogin" name="btnLogin" type="button" value="Login" onclick="onClick()"></p>
42
+
43
+ </div>
44
+
45
+ <div id="result" class="style"></div><br/>
46
+
47
+ </body>
48
+ </html>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .style{
8
+ width: 400px;
9
+ height: 50px;
10
+ font-size: 26px;
11
+ line-height: 50px;
12
+ text-align: center;
13
+ }
14
+ </style>
15
+ <script>
16
+ function onClick(){
17
+ const element = document.getElementById("result");
18
+ element.innerText = "Button Pressed Successfully";
19
+ }
20
+ </script>
21
+ </head>
22
+ <body>
23
+ <h1>Press Button</h1>
24
+ <div id="result" class="style"></div><br/>
25
+ <label for="btn-pressid">Press button</label>
26
+ <button id="btn-pressid" class="btn-pressclass" name="btn-pressname" onclick="onClick()">Button</button>
27
+
28
+ <input type="submit" id="submit-pressid" class="submit-pressclass" name="submit-pressname" value="Submit" onclick="onClick()" />
29
+
30
+ </body>
31
+ </html>
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <title>Press Button</title>
6
+ <style>
7
+ .style{
8
+ width: 400px;
9
+ height: 50px;
10
+ font-size: 26px;
11
+ line-height: 50px;
12
+ text-align: center;
13
+ }
14
+ </style>
15
+ <script>
16
+ function onClick(){
17
+ const element = document.getElementById("result");
18
+ element.innerText = "Button Pressed Successfully";
19
+ }
20
+ </script>
21
+ </head>
22
+ <body>
23
+ <h1>Press Button</h1>
24
+ <div id="result" class="style"></div><br/>
25
+ <input id="btnClick" class="btnClick" name="btnClick" type="button" value="Submit" onclick="onClick()">
26
+ </body>
27
+ </html>