How to use ConsoleColor method in Nightwatch

Best JavaScript code snippet using nightwatch

Run Nightwatch automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

NamedColors.js

Source: NamedColors.js Github

copy
1import { ConsoleColor } from "./ConsoleColor.js";
2export class NamedColors {
3}
4NamedColors.AliceBlue = new ConsoleColor("#F0F8FF");
5NamedColors.AntiqueWhite = new ConsoleColor("#FAEBD7");
6NamedColors.Aqua = new ConsoleColor("#00FFFF");
7NamedColors.Aquamarine = new ConsoleColor("#7FFFD4");
8NamedColors.Azure = new ConsoleColor("#F0FFFF");
9NamedColors.Beige = new ConsoleColor("#F5F5DC");
10NamedColors.Bisque = new ConsoleColor("#FFE4C4");
11NamedColors.Black = new ConsoleColor("#000000");
12NamedColors.BlanchedAlmond = new ConsoleColor("#FFEBCD");
13NamedColors.Blue = new ConsoleColor("#0000FF");
14NamedColors.BlueViolet = new ConsoleColor("#8A2BE2");
15NamedColors.Brown = new ConsoleColor("#A52A2A");
16NamedColors.BurlyWood = new ConsoleColor("#DEB887");
17NamedColors.CadetBlue = new ConsoleColor("#5F9EA0");
18NamedColors.Chartreuse = new ConsoleColor("#7FFF00");
19NamedColors.Chocolate = new ConsoleColor("#D2691E");
20NamedColors.Coral = new ConsoleColor("#FF7F50");
21NamedColors.CornflowerBlue = new ConsoleColor("#6495ED");
22NamedColors.Cornsilk = new ConsoleColor("#FFF8DC");
23NamedColors.Crimson = new ConsoleColor("#DC143C");
24NamedColors.Cyan = new ConsoleColor("#00FFFF");
25NamedColors.DarkBlue = new ConsoleColor("#00008B");
26NamedColors.DarkCyan = new ConsoleColor("#008B8B");
27NamedColors.DarkGoldenRod = new ConsoleColor("#B8860B");
28NamedColors.DarkGray = new ConsoleColor("#A9A9A9");
29NamedColors.DarkGrey = new ConsoleColor("#A9A9A9");
30NamedColors.DarkGreen = new ConsoleColor("#006400");
31NamedColors.DarkKhaki = new ConsoleColor("#BDB76B");
32NamedColors.DarkMagenta = new ConsoleColor("#8B008B");
33NamedColors.DarkOliveGreen = new ConsoleColor("#556B2F");
34NamedColors.DarkOrange = new ConsoleColor("#FF8C00");
35NamedColors.DarkOrchid = new ConsoleColor("#9932CC");
36NamedColors.DarkRed = new ConsoleColor("#8B0000");
37NamedColors.DarkSalmon = new ConsoleColor("#E9967A");
38NamedColors.DarkSeaGreen = new ConsoleColor("#8FBC8F");
39NamedColors.DarkSlateBlue = new ConsoleColor("#483D8B");
40NamedColors.DarkSlateGray = new ConsoleColor("#2F4F4F");
41NamedColors.DarkSlateGrey = new ConsoleColor("#2F4F4F");
42NamedColors.DarkTurquoise = new ConsoleColor("#00CED1");
43NamedColors.DarkViolet = new ConsoleColor("#9400D3");
44NamedColors.DeepPink = new ConsoleColor("#FF1493");
45NamedColors.DeepSkyBlue = new ConsoleColor("#00BFFF");
46NamedColors.DimGray = new ConsoleColor("#696969");
47NamedColors.DimGrey = new ConsoleColor("#696969");
48NamedColors.DodgerBlue = new ConsoleColor("#1E90FF");
49NamedColors.FireBrick = new ConsoleColor("#B22222");
50NamedColors.FloralWhite = new ConsoleColor("#FFFAF0");
51NamedColors.ForestGreen = new ConsoleColor("#228B22");
52NamedColors.Fuchsia = new ConsoleColor("#FF00FF");
53NamedColors.Gainsboro = new ConsoleColor("#DCDCDC");
54NamedColors.GhostWhite = new ConsoleColor("#F8F8FF");
55NamedColors.Gold = new ConsoleColor("#FFD700");
56NamedColors.GoldenRod = new ConsoleColor("#DAA520");
57NamedColors.Gray = new ConsoleColor("#808080");
58NamedColors.Grey = new ConsoleColor("#808080");
59NamedColors.Green = new ConsoleColor("#008000");
60NamedColors.GreenYellow = new ConsoleColor("#ADFF2F");
61NamedColors.HoneyDew = new ConsoleColor("#F0FFF0");
62NamedColors.HotPink = new ConsoleColor("#FF69B4");
63NamedColors.IndianRed = new ConsoleColor("#CD5C5C");
64NamedColors.Indigo = new ConsoleColor("#4B0082");
65NamedColors.Ivory = new ConsoleColor("#FFFFF0");
66NamedColors.Khaki = new ConsoleColor("#F0E68C");
67NamedColors.Lavender = new ConsoleColor("#E6E6FA");
68NamedColors.LavenderBlush = new ConsoleColor("#FFF0F5");
69NamedColors.LawnGreen = new ConsoleColor("#7CFC00");
70NamedColors.LemonChiffon = new ConsoleColor("#FFFACD");
71NamedColors.LightBlue = new ConsoleColor("#ADD8E6");
72NamedColors.LightCoral = new ConsoleColor("#F08080");
73NamedColors.LightCyan = new ConsoleColor("#E0FFFF");
74NamedColors.LightGoldenRodYellow = new ConsoleColor("#FAFAD2");
75NamedColors.LightGray = new ConsoleColor("#D3D3D3");
76NamedColors.LightGrey = new ConsoleColor("#D3D3D3");
77NamedColors.LightGreen = new ConsoleColor("#90EE90");
78NamedColors.LightPink = new ConsoleColor("#FFB6C1");
79NamedColors.LightSalmon = new ConsoleColor("#FFA07A");
80NamedColors.LightSeaGreen = new ConsoleColor("#20B2AA");
81NamedColors.LightSkyBlue = new ConsoleColor("#87CEFA");
82NamedColors.LightSlateGray = new ConsoleColor("#778899");
83NamedColors.LightSlateGrey = new ConsoleColor("#778899");
84NamedColors.LightSteelBlue = new ConsoleColor("#B0C4DE");
85NamedColors.LightYellow = new ConsoleColor("#FFFFE0");
86NamedColors.Lime = new ConsoleColor("#00FF00");
87NamedColors.LimeGreen = new ConsoleColor("#32CD32");
88NamedColors.Linen = new ConsoleColor("#FAF0E6");
89NamedColors.Magenta = new ConsoleColor("#FF00FF");
90NamedColors.Maroon = new ConsoleColor("#800000");
91NamedColors.MediumAquaMarine = new ConsoleColor("#66CDAA");
92NamedColors.MediumBlue = new ConsoleColor("#0000CD");
93NamedColors.MediumOrchid = new ConsoleColor("#BA55D3");
94NamedColors.MediumPurple = new ConsoleColor("#9370DB");
95NamedColors.MediumSeaGreen = new ConsoleColor("#3CB371");
96NamedColors.MediumSlateBlue = new ConsoleColor("#7B68EE");
97NamedColors.MediumSpringGreen = new ConsoleColor("#00FA9A");
98NamedColors.MediumTurquoise = new ConsoleColor("#48D1CC");
99NamedColors.MediumVioletRed = new ConsoleColor("#C71585");
100NamedColors.MidnightBlue = new ConsoleColor("#191970");
101NamedColors.MintCream = new ConsoleColor("#F5FFFA");
102NamedColors.MistyRose = new ConsoleColor("#FFE4E1");
103NamedColors.Moccasin = new ConsoleColor("#FFE4B5");
104NamedColors.NavajoWhite = new ConsoleColor("#FFDEAD");
105NamedColors.Navy = new ConsoleColor("#000080");
106NamedColors.OldLace = new ConsoleColor("#FDF5E6");
107NamedColors.Olive = new ConsoleColor("#808000");
108NamedColors.OliveDrab = new ConsoleColor("#6B8E23");
109NamedColors.Orange = new ConsoleColor("#FFA500");
110NamedColors.OrangeRed = new ConsoleColor("#FF4500");
111NamedColors.Orchid = new ConsoleColor("#DA70D6");
112NamedColors.PaleGoldenRod = new ConsoleColor("#EEE8AA");
113NamedColors.PaleGreen = new ConsoleColor("#98FB98");
114NamedColors.PaleTurquoise = new ConsoleColor("#AFEEEE");
115NamedColors.PaleVioletRed = new ConsoleColor("#DB7093");
116NamedColors.PapayaWhip = new ConsoleColor("#FFEFD5");
117NamedColors.PeachPuff = new ConsoleColor("#FFDAB9");
118NamedColors.Peru = new ConsoleColor("#CD853F");
119NamedColors.Pink = new ConsoleColor("#FFC0CB");
120NamedColors.Plum = new ConsoleColor("#DDA0DD");
121NamedColors.PowderBlue = new ConsoleColor("#B0E0E6");
122NamedColors.Purple = new ConsoleColor("#800080");
123NamedColors.RebeccaPurple = new ConsoleColor("#663399");
124NamedColors.Red = new ConsoleColor("#FF0000");
125NamedColors.RosyBrown = new ConsoleColor("#BC8F8F");
126NamedColors.RoyalBlue = new ConsoleColor("#4169E1");
127NamedColors.SaddleBrown = new ConsoleColor("#8B4513");
128NamedColors.Salmon = new ConsoleColor("#FA8072");
129NamedColors.SandyBrown = new ConsoleColor("#F4A460");
130NamedColors.SeaGreen = new ConsoleColor("#2E8B57");
131NamedColors.SeaShell = new ConsoleColor("#FFF5EE");
132NamedColors.Sienna = new ConsoleColor("#A0522D");
133NamedColors.Silver = new ConsoleColor("#C0C0C0");
134NamedColors.SkyBlue = new ConsoleColor("#87CEEB");
135NamedColors.SlateBlue = new ConsoleColor("#6A5ACD");
136NamedColors.SlateGray = new ConsoleColor("#708090");
137NamedColors.SlateGrey = new ConsoleColor("#708090");
138NamedColors.Snow = new ConsoleColor("#FFFAFA");
139NamedColors.SpringGreen = new ConsoleColor("#00FF7F");
140NamedColors.SteelBlue = new ConsoleColor("#4682B4");
141NamedColors.Tan = new ConsoleColor("#D2B48C");
142NamedColors.Teal = new ConsoleColor("#008080");
143NamedColors.Thistle = new ConsoleColor("#D8BFD8");
144NamedColors.Tomato = new ConsoleColor("#FF6347");
145NamedColors.Turquoise = new ConsoleColor("#40E0D0");
146NamedColors.Violet = new ConsoleColor("#EE82EE");
147NamedColors.Wheat = new ConsoleColor("#F5DEB3");
148NamedColors.White = new ConsoleColor("#FFFFFF");
149NamedColors.WhiteSmoke = new ConsoleColor("#F5F5F5");
150NamedColors.Yellow = new ConsoleColor("#FFFF00");
151NamedColors.YellowGreen = new ConsoleColor("#9ACD32");
152
Full Screen

BaseLogger.js

Source: BaseLogger.js Github

copy
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.BaseLogger = void 0;
4var ConsoleColor_constant_1 = require("../constants/ConsoleColor.constant");
5var BaseLogger = /** @class */ (function () {
6    function BaseLogger() {
7        this.logToConsole = function (log) {
8            switch (log.type) {
9                case "DEBUG":
10                    console.debug(ConsoleColor_constant_1.ConsoleColor.BgWhite + " " + ConsoleColor_constant_1.ConsoleColor.FgBlack, "[" + log.datetime.toLocaleString() + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "" + log.color, "[" + log.type + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "- " + log.message + "\r\n");
11                    if (log.stack) {
12                        console.debug("--Stack::");
13                        console.debug(log.stack);
14                    }
15                    break;
16                case "LOG":
17                    console.log(ConsoleColor_constant_1.ConsoleColor.BgWhite + " " + ConsoleColor_constant_1.ConsoleColor.FgBlack, "[" + log.datetime.toLocaleString() + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "" + log.color, "[ " + log.type + " ]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "- " + log.message + "\r\n");
18                    if (log.stack) {
19                        console.log("--Stack::");
20                        console.log(log.stack);
21                    }
22                    break;
23                case "ERROR":
24                    console.error(ConsoleColor_constant_1.ConsoleColor.BgWhite + " " + ConsoleColor_constant_1.ConsoleColor.FgBlack, "[" + log.datetime.toLocaleString() + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "" + log.color, "[" + log.type + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "- " + log.message + "\r\n");
25                    if (log.stack) {
26                        console.error("--Stack::");
27                        console.error(log.stack);
28                    }
29                    break;
30                case "INFO":
31                    console.info(ConsoleColor_constant_1.ConsoleColor.BgWhite + " " + ConsoleColor_constant_1.ConsoleColor.FgBlack, "[" + log.datetime.toLocaleString() + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "" + log.color, "[ " + log.type + "]", "" + ConsoleColor_constant_1.ConsoleColor.Reset, "- " + log.message + "\r\n");
32                    if (log.stack) {
33                        console.info("--Stack::");
34                        console.info(log.stack);
35                    }
36                    break;
37            }
38        };
39    }
40    return BaseLogger;
41}());
42exports.BaseLogger = BaseLogger;
43
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Nightwatch on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)