Best JavaScript code snippet using wpt
xmlWriter.js
Source:xmlWriter.js
1/* exported writeXml */2/* parse and write monitors.xml like below3 * Example configuration:4 *5 * <monitors version="2">6 * <configuration>7 * <logicalmonitor>8 * <x>0</x>9 * <y>0</y>10 * <scale>1</scale>11 * <monitor>12 * <monitorspec>13 * <connector>LVDS1</connector>14 * <vendor>Vendor A</vendor>15 * <product>Product A</product>16 * <serial>Serial A</serial>17 * </monitorspec>18 * <mode>19 * <width>1920</width>20 * <height>1080</height>21 * <rate>60.049972534179688</rate>22 * <flag>interlace</flag>23 * </mode>24 * </monitor>25 * <transform>26 * <rotation>right</rotation>27 * <flipped>no</flipped>28 * </transform>29 * <primary>yes</primary>30 * <presentation>no</presentation>31 * </logicalmonitor>32 * <logicalmonitor>33 * <x>1920</x>34 * <y>1080</y>35 * <monitor>36 * <monitorspec>37 * <connector>LVDS2</connector>38 * <vendor>Vendor B</vendor>39 * <product>Product B</product>40 * <serial>Serial B</serial>41 * </monitorspec>42 * <mode>43 * <width>1920</width>44 * <height>1080</height>45 * <rate>60.049972534179688</rate>46 * </mode>47 * <underscanning>yes</underscanning>48 * </monitor>49 * <presentation>yes</presentation>50 * </logicalmonitor>51 * <disabled>52 * <monitorspec>53 * <connector>LVDS3</connector>54 * <vendor>Vendor C</vendor>55 * <product>Product C</product>56 * <serial>Serial C</serial>57 * </monitorspec>58 * </disabled>59 * </configuration>60 * </monitors>61 *62 */63const ByteArray = imports.byteArray;64const { Gio, GLib } = imports.gi;65var monitorsXml = `${GLib.get_home_dir()}/.config/monitors.xml`;66var xmlFile = Gio.File.new_for_path(`${monitorsXml}`);67function writeXml(monitors) {68 let [savedConf, savedSpec] = readMonitorSpec();69 if (savedConf) {70 // if monitor.xml already has valid config, then exit71 if (compareSpec(savedSpec, monitors))72 return;73 let outputStream = xmlFile.replace('', false, 0, null);74 let savedConfLines = ByteArray.toString(savedConf).split('\n');75 savedConfLines.forEach((line, i) => {76 // append configuration77 if (i === 1)78 writeConf(outputStream, monitors);79 outputStream.write(`${line}\n`, null);80 });81 outputStream.close(null);82 } else {83 // write configuration from scratch84 let outputStream = xmlFile.replace('', false, 0, null);85 outputStream.write('<monitors version="2">\n', null);86 writeConf(outputStream, monitors);87 outputStream.write('</monitors>\n', null);88 outputStream.close(null);89 }90}91function readMonitorSpec() {92 if (!xmlFile.query_exists(null))93 return [null, null];94 let [res, contents] = xmlFile.load_contents(null);95 if (!res)96 return [null, null];97 // get monitorspec info from xml98 let configurations = [];99 let lines = ByteArray.toString(contents).split('\n').filter(word => word.length > 0);100 if (lines[0].includes('<monitors version="') && lines[lines.length - 1].includes('</monitors>')) {101 for (let i = 1; i < lines.length - 1; i++) {102 if (lines[i].includes('<configuration>')) {103 let monitors = [];104 for (let j = i + 1; j < lines.length; j++) {105 if (lines[j].includes('<logicalmonitor>')) {106 let monitor = new class {}();107 for (let k = j + 1; k < lines.length; k++) {108 if (lines[k].includes('<monitorspec>')) {109 monitor.connector = lines[k + 1].trim().replace('<connector>', '').replace('</connector>', '');110 monitor.vendor = lines[k + 2].trim().replace('<vendor>', '').replace('</vendor>', '');111 monitor.product = lines[k + 3].trim().replace('<product>', '').replace('</product>', '');112 monitor.serial = lines[k + 4].trim().replace('<serial>', '').replace('</serial>', '');113 } else if (lines[k].includes('</logicalmonitor>')) {114 break;115 }116 }117 if (monitor.connector && monitor.vendor && monitor.product && monitor.serial)118 monitors.push(monitor);119 } else if (lines[j].includes('</configuration>')) {120 break;121 }122 }123 if (monitors.length > 0)124 configurations.push(monitors);125 }126 }127 return [contents, configurations];128 }129 return [null, null];130}131function compareSpec(configurations, monitors) {132 for (let i = 0; i < configurations.length; i++) {133 if (configurations[i].length !== monitors.length)134 return false;135 for (let j = 0; j < monitors.length; j++) {136 let specDiff = configurations[i][j].connector === monitors[i].connector &&137 configurations[i][j].vendor === monitors[i].vendor &&138 configurations[i][j].product === monitors[i].product &&139 configurations[i][j].serial === monitors[i].serial;140 return specDiff;141 }142 }143 return false;144}145function writeConf(outputStream, monitors) {146 outputStream.write(' <configuration>\n', null);147 monitors.forEach(monitor => {148 writeLogicalMonitor(outputStream, monitor);149 });150 outputStream.write(' </configuration>\n', null);151}152function writeLogicalMonitor(outputStream, monitor) {153 outputStream.write(' <logicalmonitor>\n', null);154 outputStream.write(` <x>${monitor.x}</x>\n`, null);155 outputStream.write(` <y>${monitor.y}</y>\n`, null);156 outputStream.write(' <scale>1</scale>\n', null);157 if (monitor.isPrimary)158 outputStream.write(' <primary>yes</primary>\n', null);159 if (monitor.rotation)160 writeTransform(outputStream, monitor);161 writeMonitor(outputStream, monitor);162 outputStream.write(' </logicalmonitor>\n', null);163}164function writeTransform(outputStream, monitor) {165 outputStream.write(' <transform>\n', null);166 outputStream.write(` <rotation>${monitor.rotation}</rotation>\n`, null);167 outputStream.write(' <flipped>no</flipped>\n', null);168 outputStream.write(' </transform>\n', null);169}170function writeMonitor(outputStream, monitor) {171 outputStream.write(' <monitor>\n', null);172 outputStream.write(' <monitorspec>\n', null);173 outputStream.write(` <connector>${monitor.connector}</connector>\n`, null);174 outputStream.write(` <vendor>${monitor.vendor}</vendor>\n`, null);175 outputStream.write(` <product>${monitor.product}</product>\n`, null);176 outputStream.write(` <serial>${monitor.serial}</serial>\n`, null);177 outputStream.write(' </monitorspec>\n', null);178 outputStream.write(' <mode>\n', null);179 outputStream.write(` <width>${monitor.width}</width>\n`, null);180 outputStream.write(` <height>${monitor.height}</height>\n`, null);181 outputStream.write(` <rate>${monitor.rate}</rate>\n`, null);182 outputStream.write(' </mode>\n', null);183 outputStream.write(' </monitor>\n', null);...
java.io.OutputStream.js
Source:java.io.OutputStream.js
1/**2 * Hyperloop3 * Generated code is Copyright (c) 2017 Appcelerator, Inc. and subject to the4 * Appcelerator Platform Subscription agreement.5 *6 * WARNING: This is generated code. Modify at your own risk and without support7 *8 * @module java.io.OutputStream9 */10var Hyperloop = require('hyperloop');11var parentPackage = require('java.io');12/**13 * @class java.io.OutputStream14 * @extends java.lang.Object 15 * @constructor16 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html}17 **/18var OutputStream = function() {19 var result;20 // Allow the constructor to either invoke the real java constructor, or function as a "wrapping" method that will take21 // a single argument that is a native hyperloop proxy for this class type and just wraps it in our JS type.22 if (arguments.length == 1 && arguments[0].isNativeProxy && arguments[0].isInstanceProxy && arguments[0].isInstanceOf('java.io.OutputStream')) {23 result = arguments[0];24 }25 else {26 Ti.API.error('Cannot instantiate instance of abstract class: java.io.OutputStream. Create a subclass using java.io.OutputStream.extend();' );27 }28 this.$native = result;29 this._hasPointer = result != null;30 this._private = {};31};32var SuperClass = require('java.lang.Object');33OutputStream.prototype = Object.create(SuperClass.prototype);34OutputStream.prototype.constructor = OutputStream;35Object.defineProperty(OutputStream.prototype, 'super', {36 get: function() {37 if (!this._hasPointer) return null;38 return new OutputStream(this.$native.super);39 },40 enumerable: true41});42OutputStream.className = 'java.io.OutputStream';43OutputStream.prototype.className = 'java.io.OutputStream';44// class property45Object.defineProperty(OutputStream, 'class', {46 get: function() {47 return Hyperloop.getClass('java.io.OutputStream');48 },49 enumerable: true,50 configurable: false51});52// Allow subclassing53OutputStream.extend = function (overrides) {54 var subclassProxy = Hyperloop.extend('java.io.OutputStream');55 // Generate a JS wrapper for our dynamic subclass56 var SubClass = function() {57 var result = subclassProxy.newInstance(arguments),58 instance = this,59 copy = overrides,60 modified = {};61 function _wrapArg(arg) {62 if (arg.apiName && arg.isNativeProxy && arg.isInstanceProxy) { // Assume hyperloop proxy, wrap in JS wrapper63 var other = require(arg.apiName);64 return new other(arg);65 }66 return arg;67 }68 function _wrapArgs() {69 var newArgs = [];70 for (var i = 0; i < arguments.length; i++) {71 newArgs[i] = _wrapArg(arguments[i]);72 }73 return newArgs;74 };75 Object.keys(copy).forEach(function (each) {76 // Hang the original override method on the JS wrapper object77 instance[each] = function() {78 return copy[each].apply(instance, arguments);79 };80 // Hang a delegate on the "overrides" object we pass into Java.81 // This one wraps hyperloop proxies from Java in their JS wrapper before forwarding on82 modified[each] = function() {83 return instance[each].apply(instance, _wrapArgs.apply(this, arguments));84 }85 });86 result.setOverrides(modified);87 this.$native = result;88 this._hasPointer = result != null;89 this._private = {};90 };91 // it extends the JS wrapper for the parent type92 SubClass.prototype = Object.create(OutputStream.prototype);93 SubClass.prototype.constructor = SubClass;94 return SubClass;95};96// Cast97OutputStream.cast = function(object) {98 if (!object.$native || !object.$native.isInstanceProxy) return object;99 return new OutputStream(Hyperloop.cast('java.io.OutputStream', object.$native));100};101// Constants102// Inner classes103// Static fields104// Instance Fields105// Static methods106// Instance methods107/**108 * TODO Fill out docs more...109 * @function flush110 * @memberof111 * @instance112 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html#flush()}113 **/114OutputStream.prototype.flush = function() {115 if (!this._hasPointer) return null;116 var result = this.$native.callNativeFunction({117 func: 'flush',118 instanceMethod: true,119 args: Array.prototype.slice.call(arguments)120 });121 if (result == null) {122 return null;123 }124 // Wrap result if it's not a primitive type?125 if (result.apiName) {126 if (result.apiName === 'java.io.OutputStream') {127 return new OutputStream(result);128 } else {129 var ctor = require(result.apiName);130 return new ctor(result);131 }132 }133 return result;134};135/**136 * TODO Fill out docs more...137 * @function write138 * @memberof139 * @instance140 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html#write(int)}141 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html#write(byte[])}142 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html#write(byte[], int, int)}143 **/144OutputStream.prototype.write = function() {145 if (!this._hasPointer) return null;146 var result = this.$native.callNativeFunction({147 func: 'write',148 instanceMethod: true,149 args: Array.prototype.slice.call(arguments)150 });151 if (result == null) {152 return null;153 }154 // Wrap result if it's not a primitive type?155 if (result.apiName) {156 if (result.apiName === 'java.io.OutputStream') {157 return new OutputStream(result);158 } else {159 var ctor = require(result.apiName);160 return new ctor(result);161 }162 }163 return result;164};165/**166 * TODO Fill out docs more...167 * @function close168 * @memberof169 * @instance170 * @see {@link http://developer.android.com/reference/java/io/OutputStream.html#close()}171 **/172OutputStream.prototype.close = function() {173 if (!this._hasPointer) return null;174 var result = this.$native.callNativeFunction({175 func: 'close',176 instanceMethod: true,177 args: Array.prototype.slice.call(arguments)178 });179 if (result == null) {180 return null;181 }182 // Wrap result if it's not a primitive type?183 if (result.apiName) {184 if (result.apiName === 'java.io.OutputStream') {185 return new OutputStream(result);186 } else {187 var ctor = require(result.apiName);188 return new ctor(result);189 }190 }191 return result;192};193// export the class...
xml.js
Source:xml.js
1/* exported writeXml */2const ByteArray = imports.byteArray;3const { Gio, GLib } = imports.gi;4var monitorsXml = `${GLib.get_home_dir()}/.config/monitors.xml`;5var xmlFile = Gio.File.new_for_path(`${monitorsXml}`);6function writeXml(monitors) {7 let [savedConf, savedSpec] = readMonitorSpec();8 if (savedConf) {9 // if monitor.xml already has valid config, then exit10 if (compareSpec(savedSpec, monitors))11 return;12 let outputStream = xmlFile.replace('', false, 0, null);13 let savedConfLines = ByteArray.toString(savedConf).split('\n');14 savedConfLines.forEach((line, i) => {15 // append configuration16 if (i === 1)17 writeConf(outputStream, monitors);18 outputStream.write(`${line}\n`, null);19 });20 outputStream.close(null);21 } else {22 // write configuration from scratch23 let outputStream = xmlFile.replace('', false, 0, null);24 outputStream.write('<monitors version="2">\n', null);25 writeConf(outputStream, monitors);26 outputStream.write('</monitors>\n', null);27 outputStream.close(null);28 }29}30function readMonitorSpec() {31 if (!xmlFile.query_exists(null))32 return [null, null];33 let [res, contents] = xmlFile.load_contents(null);34 if (!res)35 return [null, null];36 // get monitorspec info from xml37 let configurations = [];38 let lines = ByteArray.toString(contents).split('\n').filter(word => word.length > 0);39 if (lines[0].includes('<monitors version="') && lines[lines.length - 1].includes('</monitors>')) {40 for (let i = 1; i < lines.length - 1; i++) {41 if (lines[i].includes('<configuration>')) {42 let monitors = [];43 for (let j = i + 1; j < lines.length; j++) {44 if (lines[j].includes('<logicalmonitor>')) {45 let monitor = new class {}();46 for (let k = j + 1; k < lines.length; k++) {47 if (lines[k].includes('<monitorspec>')) {48 monitor.connector = lines[k + 1].trim().replace('<connector>', '').replace('</connector>', '');49 monitor.vendor = lines[k + 2].trim().replace('<vendor>', '').replace('</vendor>', '');50 monitor.product = lines[k + 3].trim().replace('<product>', '').replace('</product>', '');51 monitor.serial = lines[k + 4].trim().replace('<serial>', '').replace('</serial>', '');52 } else if (lines[k].includes('</logicalmonitor>')) {53 break;54 }55 }56 if (monitor.connector && monitor.vendor && monitor.product && monitor.serial)57 monitors.push(monitor);58 } else if (lines[j].includes('</configuration>')) {59 break;60 }61 }62 if (monitors.length > 0)63 configurations.push(monitors);64 }65 }66 return [contents, configurations];67 }68 return [null, null];69}70function compareSpec(configurations, monitors) {71 for (let i = 0; i < configurations.length; i++) {72 if (configurations[i].length !== monitors.length)73 return false;74 for (let j = 0; j < monitors.length; j++) {75 let specDiff = configurations[i][j].connector === monitors[i].connector &&76 configurations[i][j].vendor === monitors[i].vendor &&77 configurations[i][j].product === monitors[i].product &&78 configurations[i][j].serial === monitors[i].serial;79 return specDiff;80 }81 }82 return false;83}84function writeConf(outputStream, monitors) {85 outputStream.write(' <configuration>\n', null);86 monitors.forEach(monitor => {87 writeLogicalMonitor(outputStream, monitor);88 });89 outputStream.write(' </configuration>\n', null);90}91function writeLogicalMonitor(outputStream, monitor) {92 outputStream.write(' <logicalmonitor>\n', null);93 outputStream.write(` <x>${monitor.x}</x>\n`, null);94 outputStream.write(` <y>${monitor.y}</y>\n`, null);95 outputStream.write(' <scale>1</scale>\n', null);96 if (monitor.isPrimary)97 outputStream.write(' <primary>yes</primary>\n', null);98 if (monitor.rotation)99 writeTransform(outputStream, monitor);100 writeMonitor(outputStream, monitor);101 outputStream.write(' </logicalmonitor>\n', null);102}103function writeTransform(outputStream, monitor) {104 outputStream.write(' <transform>\n', null);105 outputStream.write(` <rotation>${monitor.rotation}</rotation>\n`, null);106 outputStream.write(' <flipped>no</flipped>\n', null);107 outputStream.write(' </transform>\n', null);108}109function writeMonitor(outputStream, monitor) {110 outputStream.write(' <monitor>\n', null);111 outputStream.write(' <monitorspec>\n', null);112 outputStream.write(` <connector>${monitor.connector}</connector>\n`, null);113 outputStream.write(` <vendor>${monitor.vendor}</vendor>\n`, null);114 outputStream.write(` <product>${monitor.product}</product>\n`, null);115 outputStream.write(` <serial>${monitor.serial}</serial>\n`, null);116 outputStream.write(' </monitorspec>\n', null);117 outputStream.write(' <mode>\n', null);118 outputStream.write(` <width>${monitor.width}</width>\n`, null);119 outputStream.write(` <height>${monitor.height}</height>\n`, null);120 outputStream.write(` <rate>${monitor.rate}</rate>\n`, null);121 outputStream.write(' </mode>\n', null);122 outputStream.write(' </monitor>\n', null);...
codeWriter.ts
Source:codeWriter.ts
1import fs from "fs";2import { CommandType } from "../src/parser";3export class CodeWriter {4 outputStream: fs.WriteStream;5 fileName: string;6 constructor(outputStream: fs.WriteStream) {7 this.outputStream = outputStream;8 this.outputStream.cork();9 this.fileName = "";10 // Initial code11 this.outputStream.write("@256\nD=A\n@SP\nM=D\n");12 }13 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types14 setFileName(fileName: string) {15 this.fileName = fileName;16 }17 writePushPop(command: CommandType, segment: string, index: number): void {18 this.outputStream.write("@" + index.toString() + "\n");19 this.outputStream.write("D=A\n");20 this.outputStream.write("@SP\n");21 this.outputStream.write("A=M\n");22 this.outputStream.write("M=D\n");23 this.outputStream.write("@SP\n");24 this.outputStream.write("AM=M+1\n");25 }26 // eslint-disable-next-line @typescript-eslint/no-unused-vars27 writeArithmetic(command: string): void {28 this.outputStream.write("@SP\n");29 this.outputStream.write("AM=M-1\n");30 this.outputStream.write("D=M\n");31 this.outputStream.write("A=A-1\n");32 this.outputStream.write("M=M+D\n");33 }34 close(): void {35 this.outputStream.end();36 }...
Using AI Code Generation
1var wptools = require('wptools');2var fs = require('fs');3var stream = fs.createWriteStream("output.txt");4var page = wptools.page('Albert Einstein');5page.outputStream(stream);6page.get(function(err, resp) {7 if (err) {8 console.log(err);9 }10 console.log(resp);11});12var wptools = require('wptools');13var page = wptools.page('Albert Einstein');14page.getCategories(function(err, resp) {15 if (err) {16 console.log(err);17 }18 console.log(resp);19});20var wptools = require('wptools');21var page = wptools.page('Albert Einstein');22page.getExternalLinks(function(err, resp) {23 if (err) {24 console.log(err);25 }26 console.log(resp);27});28var wptools = require('wptools');29var page = wptools.page('Albert Einstein');30page.getImages(function(err, resp) {31 if (err) {32 console.log(err);33 }34 console.log(resp);35});36var wptools = require('wptools');37var page = wptools.page('Albert Einstein');38page.getLangLinks(function(err, resp) {39 if (err) {40 console.log(err);41 }42 console.log(resp);43});44var wptools = require('wptools');45var page = wptools.page('Albert Einstein');46page.getLinks(function(err, resp) {47 if (err) {48 console.log(err);49 }50 console.log(resp
Using AI Code Generation
1var wptools = require('wptools');2var fs = require('fs');3var util = require('util');4var stream = fs.createWriteStream("output.txt");5stream.once('open', function(fd) {6 var page = wptools.page('Albert Einstein').get(function(err, info) {7 if (err) {8 console.log(err);9 return;10 }11 stream.write("Name: " + info.fullname + "\n");12 stream.write("Birth: " + info.birth + "\n");13 stream.write("Death: " + info.death + "\n");14 stream.write("Description: " + info.description + "\n");15 stream.write("Image: " + info.image + "\n");16 stream.write("Title: " + info.title + "\n");17 stream.end();18 });19});
Using AI Code Generation
1var wptools = require('wptools');2var fs = require('fs');3var page = wptools.page('Barack Obama');4page.outputStream('html', fs.createWriteStream('barack_obama.html'));5page.outputStream('text', fs.createWriteStream('barack_obama.txt'));6page.outputStream('wikitext', fs.createWriteStream('barack_obama.wikitext'));7page.get(function(err, resp) {8 console.log(resp);9});10var wptools = require('wptools');11var fs = require('fs');12var page = wptools.page('Barack Obama');13page.outputStream('html', fs.createWriteStream('barack_obama.html'));14page.outputStream('text', fs.createWriteStream('barack_obama.txt'));15page.outputStream('wikitext', fs.createWriteStream('barack_obama.wikitext'));16page.get(function(err, resp) {17 console.log(resp);18});19var wptools = require('wptools');20var fs = require('fs');21var page = wptools.page('Barack Obama');22page.outputStream('html', fs.createWriteStream('barack_obama.html'));23page.outputStream('text', fs.createWriteStream('barack_obama.txt'));24page.outputStream('wikitext', fs.createWriteStream('barack_obama.wikitext'));25page.get(function(err, resp) {26 console.log(resp);27});
Using AI Code Generation
1const wptools = require('wptools');2wptools.page('Barack Obama')3 .outputStream('text')4 .then(function (res) {5 res.pipe(process.stdout);6 })7 .catch(function (err) {8 console.log(err);9 });10### wptools.page(title)11#### .get()12#### .getImages()13#### .getCategories()14#### .getInfobox()15#### .getExtract()16#### .getCoordinates()17#### .getLanglinks()18#### .getLinks()19#### .getReferences()20#### .getSections()21#### .getTemplates()
Using AI Code Generation
1var wptools = require('wptools');2var fs = require('fs');3var options = {4};5var page = wptools.page('Wikipedia', options);6var stream = fs.createWriteStream('output.json');7page.outputStream(stream)8 .then(function (response) {9 console.log('done');10 })11 .catch(function (error) {12 console.log(error);13 });14[MIT](LICENSE)
Using AI Code Generation
1var wptools = require('wptools');2var fs = require('fs');3var page = wptools.page('Barack_Obama');4page.get(function(err, response) {5 var infobox = response.infobox();6 var json = JSON.stringify(infobox, null, 2);7 fs.writeFile('infobox.json', json, function(err) {8 if (err) {9 console.log(err);10 } else {11 console.log('File saved.');12 }13 });14});
Using AI Code Generation
1var wpt = require('webpagetest');2var fs = require('fs');3var wpt = new WebPageTest('www.webpagetest.org', 'A.3f1b0a3d0f4b4c1b4d4a4c0e4d4b4c0a');4var test = wpt.runTest(testUrl, {5}, function(err, data) {6 if (err) return console.error(err);7 console.log('Test %d from %s complete!', data.data.testId, data.data.from);8 var testId = data.data.testId;9 wpt.getTestResults(testId, function(err, data) {10 if (err) return console.error(err);11 console.log('Test %d from %s complete!', data.data.testId, data.data.from);12 });13});14var output = fs.createWriteStream('test.json');15wpt.outputStream(test, output);16{17 "data": {18 "data": {19 "testInfo": {
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!