How to use reader method in wpt

Best JavaScript code snippet using wpt

4ca86ab5.cljs.tools.reader.reader_types.js

Source:4ca86ab5.cljs.tools.reader.reader_types.js Github

copy

Full Screen

...552});553/**554 * Creates a StringReader from a given string555 */556cljs.tools.reader.reader_types.string_reader = (function cljs$tools$reader$reader_types$string_reader(s){557return (new cljs.tools.reader.reader_types.StringReader(s,cljs.core.count(s),(0)));558});559/**560 * Creates a PushbackReader from a given string561 */562cljs.tools.reader.reader_types.string_push_back_reader = (function cljs$tools$reader$reader_types$string_push_back_reader(var_args){563var G__24079 = arguments.length;564switch (G__24079) {565case 1:566return cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));567break;568case 2:569return cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));570break;571default:572throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));573}574});575(cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$1 = (function (s){576return cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$2(s,(1));577}));578(cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$2 = (function (s,buf_len){579return (new cljs.tools.reader.reader_types.PushbackReader(cljs.tools.reader.reader_types.string_reader(s),cljs.core.object_array.cljs$core$IFn$_invoke$arity$1(buf_len),buf_len,buf_len));580}));581(cljs.tools.reader.reader_types.string_push_back_reader.cljs$lang$maxFixedArity = 2);582cljs.tools.reader.reader_types.node_readable_push_back_reader = (function cljs$tools$reader$reader_types$node_readable_push_back_reader(readable){583return (new cljs.tools.reader.reader_types.PushbackReader((new cljs.tools.reader.reader_types.NodeReadableReader(readable,null)),cljs.core.object_array.cljs$core$IFn$_invoke$arity$1((1)),(1),(1)));584});585/**586 * Creates an IndexingPushbackReader from a given string or PushbackReader587 */588cljs.tools.reader.reader_types.indexing_push_back_reader = (function cljs$tools$reader$reader_types$indexing_push_back_reader(var_args){589var G__24099 = arguments.length;590switch (G__24099) {591case 1:592return cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));593break;594case 2:595return cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));596break;597case 3:598return cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));599break;600default:601throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));602}603});604(cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$1 = (function (s_or_rdr){605return cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$2(s_or_rdr,(1));606}));607(cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$2 = (function (s_or_rdr,buf_len){608return cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$3(s_or_rdr,buf_len,null);609}));610(cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$core$IFn$_invoke$arity$3 = (function (s_or_rdr,buf_len,file_name){611return (new cljs.tools.reader.reader_types.IndexingPushbackReader(((typeof s_or_rdr === 'string')?cljs.tools.reader.reader_types.string_push_back_reader.cljs$core$IFn$_invoke$arity$2(s_or_rdr,buf_len):s_or_rdr),(1),(1),true,null,(0),file_name));612}));613(cljs.tools.reader.reader_types.indexing_push_back_reader.cljs$lang$maxFixedArity = 3);614/**615 * Creates a SourceLoggingPushbackReader from a given string or PushbackReader616 */617cljs.tools.reader.reader_types.source_logging_push_back_reader = (function cljs$tools$reader$reader_types$source_logging_push_back_reader(var_args){618var G__24118 = arguments.length;619switch (G__24118) {620case 1:621return cljs.tools.reader.reader_types.source_logging_push_back_reader.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));622break;623case 2:624return cljs.tools.reader.reader_types.source_logging_push_back_reader.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));625break;626case 3:627return cljs.tools.reader.reader_types.source_logging_push_back_reader.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));628break;629default:630throw (new Error(["Invalid arity: ",cljs.core.str.cljs$core$IFn$_invoke$arity$1(arguments.length)].join('')));631}...

Full Screen

Full Screen

rs-test-templates.js

Source:rs-test-templates.js Github

copy

Full Screen

1'use strict';2// These tests can be run against any readable stream produced by the web platform that meets the given descriptions.3// For readable stream tests, the factory should return the stream. For reader tests, the factory should return a4// { stream, reader } object. (You can use this to vary the time at which you acquire a reader.)5self.templatedRSEmpty = (label, factory) => {6 test(() => {}, 'Running templatedRSEmpty with ' + label);7 test(() => {8 const rs = factory();9 assert_equals(typeof rs.locked, 'boolean', 'has a boolean locked getter');10 assert_equals(typeof rs.cancel, 'function', 'has a cancel method');11 assert_equals(typeof rs.getReader, 'function', 'has a getReader method');12 assert_equals(typeof rs.pipeThrough, 'function', 'has a pipeThrough method');13 assert_equals(typeof rs.pipeTo, 'function', 'has a pipeTo method');14 assert_equals(typeof rs.tee, 'function', 'has a tee method');15 }, label + ': instances have the correct methods and properties');16 test(() => {17 const rs = factory();18 assert_throws(new RangeError(), () => rs.getReader({ mode: '' }), 'empty string mode should throw');19 assert_throws(new RangeError(), () => rs.getReader({ mode: null }), 'null mode should throw');20 assert_throws(new RangeError(), () => rs.getReader({ mode: 'asdf' }), 'asdf mode should throw');21 assert_throws(new TypeError(), () => rs.getReader(null), 'null should throw');22 }, label + ': calling getReader with invalid arguments should throw appropriate errors');23};24self.templatedRSClosed = (label, factory) => {25 test(() => {}, 'Running templatedRSClosed with ' + label);26 promise_test(() => {27 const rs = factory();28 const cancelPromise1 = rs.cancel();29 const cancelPromise2 = rs.cancel();30 assert_not_equals(cancelPromise1, cancelPromise2, 'cancel() calls should return distinct promises');31 return Promise.all([32 cancelPromise1.then(v => assert_equals(v, undefined, 'first cancel() call should fulfill with undefined')),33 cancelPromise2.then(v => assert_equals(v, undefined, 'second cancel() call should fulfill with undefined'))34 ]);35 }, label + ': cancel() should return a distinct fulfilled promise each time');36 test(() => {37 const rs = factory();38 assert_false(rs.locked, 'locked getter should return false');39 }, label + ': locked should be false');40 test(() => {41 const rs = factory();42 rs.getReader(); // getReader() should not throw.43 }, label + ': getReader() should be OK');44 test(() => {45 const rs = factory();46 const reader = rs.getReader();47 reader.releaseLock();48 const reader2 = rs.getReader(); // Getting a second reader should not throw.49 reader2.releaseLock();50 rs.getReader(); // Getting a third reader should not throw.51 }, label + ': should be able to acquire multiple readers if they are released in succession');52 test(() => {53 const rs = factory();54 rs.getReader();55 assert_throws(new TypeError(), () => rs.getReader(), 'getting a second reader should throw');56 assert_throws(new TypeError(), () => rs.getReader(), 'getting a third reader should throw');57 }, label + ': should not be able to acquire a second reader if we don\'t release the first one');58};59self.templatedRSErrored = (label, factory, error) => {60 test(() => {}, 'Running templatedRSErrored with ' + label);61 promise_test(t => {62 const rs = factory();63 const reader = rs.getReader();64 return Promise.all([65 promise_rejects(t, error, reader.closed),66 promise_rejects(t, error, reader.read())67 ]);68 }, label + ': getReader() should return a reader that acts errored');69 promise_test(t => {70 const rs = factory();71 const reader = rs.getReader();72 return Promise.all([73 promise_rejects(t, error, reader.read()),74 promise_rejects(t, error, reader.read()),75 promise_rejects(t, error, reader.closed)76 ]);77 }, label + ': read() twice should give the error each time');78 test(() => {79 const rs = factory();80 assert_false(rs.locked, 'locked getter should return false');81 }, label + ': locked should be false');82};83self.templatedRSErroredSyncOnly = (label, factory, error) => {84 test(() => {}, 'Running templatedRSErroredSyncOnly with ' + label);85 promise_test(t => {86 const rs = factory();87 rs.getReader().releaseLock();88 const reader = rs.getReader(); // Calling getReader() twice does not throw (the stream is not locked).89 return promise_rejects(t, error, reader.closed);90 }, label + ': should be able to obtain a second reader, with the correct closed promise');91 test(() => {92 const rs = factory();93 rs.getReader();94 assert_throws(new TypeError(), () => rs.getReader(), 'getting a second reader should throw a TypeError');95 assert_throws(new TypeError(), () => rs.getReader(), 'getting a third reader should throw a TypeError');96 }, label + ': should not be able to obtain additional readers if we don\'t release the first lock');97 promise_test(t => {98 const rs = factory();99 const cancelPromise1 = rs.cancel();100 const cancelPromise2 = rs.cancel();101 assert_not_equals(cancelPromise1, cancelPromise2, 'cancel() calls should return distinct promises');102 return Promise.all([103 promise_rejects(t, error, cancelPromise1),104 promise_rejects(t, error, cancelPromise2)105 ]);106 }, label + ': cancel() should return a distinct rejected promise each time');107 promise_test(t => {108 const rs = factory();109 const reader = rs.getReader();110 const cancelPromise1 = reader.cancel();111 const cancelPromise2 = reader.cancel();112 assert_not_equals(cancelPromise1, cancelPromise2, 'cancel() calls should return distinct promises');113 return Promise.all([114 promise_rejects(t, error, cancelPromise1),115 promise_rejects(t, error, cancelPromise2)116 ]);117 }, label + ': reader cancel() should return a distinct rejected promise each time');118};119self.templatedRSEmptyReader = (label, factory) => {120 test(() => {}, 'Running templatedRSEmptyReader with ' + label);121 test(() => {122 const reader = factory().reader;123 assert_true('closed' in reader, 'has a closed property');124 assert_equals(typeof reader.closed.then, 'function', 'closed property is thenable');125 assert_equals(typeof reader.cancel, 'function', 'has a cancel method');126 assert_equals(typeof reader.read, 'function', 'has a read method');127 assert_equals(typeof reader.releaseLock, 'function', 'has a releaseLock method');128 }, label + ': instances have the correct methods and properties');129 test(() => {130 const stream = factory().stream;131 assert_true(stream.locked, 'locked getter should return true');132 }, label + ': locked should be true');133 promise_test(t => {134 const reader = factory().reader;135 reader.read().then(136 t.unreached_func('read() should not fulfill'),137 t.unreached_func('read() should not reject')138 );139 return delay(500);140 }, label + ': read() should never settle');141 promise_test(t => {142 const reader = factory().reader;143 reader.read().then(144 t.unreached_func('read() should not fulfill'),145 t.unreached_func('read() should not reject')146 );147 reader.read().then(148 t.unreached_func('read() should not fulfill'),149 t.unreached_func('read() should not reject')150 );151 return delay(500);152 }, label + ': two read()s should both never settle');153 test(() => {154 const reader = factory().reader;155 assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');156 }, label + ': read() should return distinct promises each time');157 test(() => {158 const stream = factory().stream;159 assert_throws(new TypeError(), () => stream.getReader(), 'stream.getReader() should throw a TypeError');160 }, label + ': getReader() again on the stream should fail');161 promise_test(t => {162 const streamAndReader = factory();163 const stream = streamAndReader.stream;164 const reader = streamAndReader.reader;165 reader.read().then(166 t.unreached_func('first read() should not fulfill'),167 t.unreached_func('first read() should not reject')168 );169 reader.read().then(170 t.unreached_func('second read() should not fulfill'),171 t.unreached_func('second read() should not reject')172 );173 reader.closed.then(174 t.unreached_func('closed should not fulfill'),175 t.unreached_func('closed should not reject')176 );177 assert_throws(new TypeError(), () => reader.releaseLock(), 'releaseLock should throw a TypeError');178 assert_true(stream.locked, 'the stream should still be locked');179 return delay(500);180 }, label + ': releasing the lock with pending read requests should throw but the read requests should stay pending');181 promise_test(t => {182 const reader = factory().reader;183 reader.releaseLock();184 return Promise.all([185 promise_rejects(t, new TypeError(), reader.read()),186 promise_rejects(t, new TypeError(), reader.read())187 ]);188 }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');189 promise_test(t => {190 const reader = factory().reader;191 const closedBefore = reader.closed;192 reader.releaseLock();193 const closedAfter = reader.closed;194 assert_equals(closedBefore, closedAfter, 'the closed promise should not change identity');195 return promise_rejects(t, new TypeError(), closedBefore);196 }, label + ': releasing the lock should cause closed calls to reject with a TypeError');197 test(() => {198 const streamAndReader = factory();199 const stream = streamAndReader.stream;200 const reader = streamAndReader.reader;201 reader.releaseLock();202 assert_false(stream.locked, 'locked getter should return false');203 }, label + ': releasing the lock should cause locked to become false');204 promise_test(() => {205 const reader = factory().reader;206 reader.cancel();207 return reader.read().then(r => {208 assert_object_equals(r, { value: undefined, done: true }, 'read()ing from the reader should give a done result');209 });210 }, label + ': canceling via the reader should cause the reader to act closed');211 promise_test(t => {212 const stream = factory().stream;213 return promise_rejects(t, new TypeError(), stream.cancel());214 }, label + ': canceling via the stream should fail');215};216self.templatedRSClosedReader = (label, factory) => {217 test(() => {}, 'Running templatedRSClosedReader with ' + label);218 promise_test(() => {219 const reader = factory().reader;220 return reader.read().then(v => {221 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');222 });223 }, label + ': read() should fulfill with { value: undefined, done: true }');224 promise_test(() => {225 const reader = factory().reader;226 return Promise.all([227 reader.read().then(v => {228 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');229 }),230 reader.read().then(v => {231 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');232 })233 ]);234 }, label + ': read() multiple times should fulfill with { value: undefined, done: true }');235 promise_test(() => {236 const reader = factory().reader;237 return reader.read().then(() => reader.read()).then(v => {238 assert_object_equals(v, { value: undefined, done: true }, 'read() should fulfill correctly');239 });240 }, label + ': read() should work when used within another read() fulfill callback');241 promise_test(() => {242 const reader = factory().reader;243 return reader.closed.then(v => assert_equals(v, undefined, 'reader closed should fulfill with undefined'));244 }, label + ': closed should fulfill with undefined');245 promise_test(t => {246 const reader = factory().reader;247 const closedBefore = reader.closed;248 reader.releaseLock();249 const closedAfter = reader.closed;250 assert_not_equals(closedBefore, closedAfter, 'the closed promise should change identity');251 return Promise.all([252 closedBefore.then(v => assert_equals(v, undefined, 'reader.closed acquired before release should fulfill')),253 promise_rejects(t, new TypeError(), closedAfter)254 ]);255 }, label + ': releasing the lock should cause closed to reject and change identity');256 promise_test(() => {257 const reader = factory().reader;258 const cancelPromise1 = reader.cancel();259 const cancelPromise2 = reader.cancel();260 const closedReaderPromise = reader.closed;261 assert_not_equals(cancelPromise1, cancelPromise2, 'cancel() calls should return distinct promises');262 assert_not_equals(cancelPromise1, closedReaderPromise, 'cancel() promise 1 should be distinct from reader.closed');263 assert_not_equals(cancelPromise2, closedReaderPromise, 'cancel() promise 2 should be distinct from reader.closed');264 return Promise.all([265 cancelPromise1.then(v => assert_equals(v, undefined, 'first cancel() should fulfill with undefined')),266 cancelPromise2.then(v => assert_equals(v, undefined, 'second cancel() should fulfill with undefined'))267 ]);268 }, label + ': cancel() should return a distinct fulfilled promise each time');269};270self.templatedRSErroredReader = (label, factory, error) => {271 test(() => {}, 'Running templatedRSErroredReader with ' + label);272 promise_test(t => {273 const reader = factory().reader;274 return promise_rejects(t, error, reader.closed);275 }, label + ': closed should reject with the error');276 promise_test(t => {277 const reader = factory().reader;278 const closedBefore = reader.closed;279 return promise_rejects(t, error, closedBefore).then(() => {280 reader.releaseLock();281 const closedAfter = reader.closed;282 assert_not_equals(closedBefore, closedAfter, 'the closed promise should change identity');283 return promise_rejects(t, new TypeError(), closedAfter);284 });285 }, label + ': releasing the lock should cause closed to reject and change identity');286 promise_test(t => {287 const reader = factory().reader;288 return promise_rejects(t, error, reader.read());289 }, label + ': read() should reject with the error');290};291self.templatedRSTwoChunksOpenReader = (label, factory, chunks) => {292 test(() => {}, 'Running templatedRSTwoChunksOpenReader with ' + label);293 promise_test(() => {294 const reader = factory().reader;295 return Promise.all([296 reader.read().then(r => {297 assert_object_equals(r, { value: chunks[0], done: false }, 'first result should be correct');298 }),299 reader.read().then(r => {300 assert_object_equals(r, { value: chunks[1], done: false }, 'second result should be correct');301 })302 ]);303 }, label + ': calling read() twice without waiting will eventually give both chunks (sequential)');304 promise_test(() => {305 const reader = factory().reader;306 return reader.read().then(r => {307 assert_object_equals(r, { value: chunks[0], done: false }, 'first result should be correct');308 return reader.read().then(r2 => {309 assert_object_equals(r2, { value: chunks[1], done: false }, 'second result should be correct');310 });311 });312 }, label + ': calling read() twice without waiting will eventually give both chunks (nested)');313 test(() => {314 const reader = factory().reader;315 assert_not_equals(reader.read(), reader.read(), 'the promises returned should be distinct');316 }, label + ': read() should return distinct promises each time');317 promise_test(() => {318 const reader = factory().reader;319 const promise1 = reader.closed.then(v => {320 assert_equals(v, undefined, 'reader closed should fulfill with undefined');321 });322 const promise2 = reader.read().then(r => {323 assert_object_equals(r, { value: chunks[0], done: false },324 'promise returned before cancellation should fulfill with a chunk');325 });326 reader.cancel();327 const promise3 = reader.read().then(r => {328 assert_object_equals(r, { value: undefined, done: true },329 'promise returned after cancellation should fulfill with an end-of-stream signal');330 });331 return Promise.all([promise1, promise2, promise3]);332 }, label + ': cancel() after a read() should still give that single read result');333};334self.templatedRSTwoChunksClosedReader = function (label, factory, chunks) {335 test(() => {}, 'Running templatedRSTwoChunksClosedReader with ' + label);336 promise_test(() => {337 const reader = factory().reader;338 return Promise.all([339 reader.read().then(r => {340 assert_object_equals(r, { value: chunks[0], done: false }, 'first result should be correct');341 }),342 reader.read().then(r => {343 assert_object_equals(r, { value: chunks[1], done: false }, 'second result should be correct');344 }),345 reader.read().then(r => {346 assert_object_equals(r, { value: undefined, done: true }, 'third result should be correct');347 })348 ]);349 }, label + ': third read(), without waiting, should give { value: undefined, done: true } (sequential)');350 promise_test(() => {351 const reader = factory().reader;352 return reader.read().then(r => {353 assert_object_equals(r, { value: chunks[0], done: false }, 'first result should be correct');354 return reader.read().then(r2 => {355 assert_object_equals(r2, { value: chunks[1], done: false }, 'second result should be correct');356 return reader.read().then(r3 => {357 assert_object_equals(r3, { value: undefined, done: true }, 'third result should be correct');358 });359 });360 });361 }, label + ': third read(), without waiting, should give { value: undefined, done: true } (nested)');362 promise_test(() => {363 const streamAndReader = factory();364 const stream = streamAndReader.stream;365 const reader = streamAndReader.reader;366 assert_true(stream.locked, 'stream should start locked');367 const promise = reader.closed.then(v => {368 assert_equals(v, undefined, 'reader closed should fulfill with undefined');369 assert_true(stream.locked, 'stream should remain locked');370 });371 reader.read();372 reader.read();373 return promise;374 }, label +375 ': draining the stream via read() should cause the reader closed promise to fulfill, but locked stays true');376 promise_test(() => {377 const streamAndReader = factory();378 const stream = streamAndReader.stream;379 const reader = streamAndReader.reader;380 const promise = reader.closed.then(() => {381 assert_true(stream.locked, 'the stream should start locked');382 reader.releaseLock(); // Releasing the lock after reader closed should not throw.383 assert_false(stream.locked, 'the stream should end unlocked');384 });385 reader.read();386 reader.read();387 return promise;388 }, label + ': releasing the lock after the stream is closed should cause locked to become false');389 promise_test(t => {390 const reader = factory().reader;391 reader.releaseLock();392 return Promise.all([393 promise_rejects(t, new TypeError(), reader.read()),394 promise_rejects(t, new TypeError(), reader.read()),395 promise_rejects(t, new TypeError(), reader.read())396 ]);397 }, label + ': releasing the lock should cause further read() calls to reject with a TypeError');398 promise_test(() => {399 const streamAndReader = factory();400 const stream = streamAndReader.stream;401 const reader = streamAndReader.reader;402 const readerClosed = reader.closed;403 assert_equals(reader.closed, readerClosed, 'accessing reader.closed twice in succession gives the same value');404 const promise = reader.read().then(() => {405 assert_equals(reader.closed, readerClosed, 'reader.closed is the same after read() fulfills');406 reader.releaseLock();407 assert_equals(reader.closed, readerClosed, 'reader.closed is the same after releasing the lock');408 const newReader = stream.getReader();409 return newReader.read();410 });411 assert_equals(reader.closed, readerClosed, 'reader.closed is the same after calling read()');412 return promise;413 }, label + ': reader\'s closed property always returns the same promise');...

Full Screen

Full Screen

reader.py

Source:reader.py Github

copy

Full Screen

...288 sys.exit(1)289#290# Another test provided by Stéphane Bidoul and checked with C#291#292def tst_reader(s):293 f = str_io(s)294 input = libxml2.inputBuffer(f)295 reader = input.newTextReader("tst")296 res = ""297 while reader.Read():298 res=res + "%s (%s) [%s] %d %d\n" % (reader.NodeType(),reader.Name(),299 reader.Value(), reader.IsEmptyElement(),300 reader.Depth())301 if reader.NodeType() == 1: # Element302 while reader.MoveToNextAttribute():303 res = res + "-- %s (%s) [%s] %d %d\n" % (reader.NodeType(),304 reader.Name(),reader.Value(),305 reader.IsEmptyElement(), reader.Depth())306 return res307 308doc="""<a><b b1="b1"/><c>content of c</c></a>"""309expect="""1 (a) [None] 0 03101 (b) [None] 1 1311-- 2 (b1) [b1] 0 23121 (c) [None] 0 13133 (#text) [content of c] 0 231415 (c) [None] 0 131515 (a) [None] 0 0316"""317res = tst_reader(doc)318if res != expect:319 print("test5 failed")320 print(res)321 sys.exit(1)322doc="""<test><b/><c/></test>"""323expect="""1 (test) [None] 0 03241 (b) [None] 1 13251 (c) [None] 1 132615 (test) [None] 0 0327"""328res = tst_reader(doc)329if res != expect:330 print("test9 failed")331 print(res)332 sys.exit(1)333doc="""<a><b>bbb</b><c>ccc</c></a>"""334expect="""1 (a) [None] 0 03351 (b) [None] 0 13363 (#text) [bbb] 0 233715 (b) [None] 0 13381 (c) [None] 0 13393 (#text) [ccc] 0 234015 (c) [None] 0 134115 (a) [None] 0 0342"""343res = tst_reader(doc)344if res != expect:345 print("test10 failed")346 print(res)347 sys.exit(1)348doc="""<test a="a"/>"""349expect="""1 (test) [None] 1 0350-- 2 (a) [a] 0 1351"""352res = tst_reader(doc)353if res != expect:354 print("test11 failed")355 print(res)356 sys.exit(1)357doc="""<test><a>aaa</a><b/></test>"""358expect="""1 (test) [None] 0 03591 (a) [None] 0 13603 (#text) [aaa] 0 236115 (a) [None] 0 13621 (b) [None] 1 136315 (test) [None] 0 0364"""365res = tst_reader(doc)366if res != expect:367 print("test12 failed")368 print(res)369 sys.exit(1)370doc="""<test><p></p></test>"""371expect="""1 (test) [None] 0 03721 (p) [None] 0 137315 (p) [None] 0 137415 (test) [None] 0 0375"""376res = tst_reader(doc)377if res != expect:378 print("test13 failed")379 print(res)380 sys.exit(1)381doc="""<p></p>"""382expect="""1 (p) [None] 0 038315 (p) [None] 0 0384"""385res = tst_reader(doc)386if res != expect:387 print("test14 failed")388 print(res)389 sys.exit(1)390#391# test from bug #108801 392#393doc="""<?xml version="1.0" standalone="no"?>394<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"395 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [396]>397<article>398xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx399</article>400"""401expect="""10 (article) [None] 0 04021 (article) [None] 0 04033 (#text) [404xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx405] 0 140615 (article) [None] 0 0407"""408res = tst_reader(doc)409if res != expect:410 print("test15 failed")411 print(res)412 sys.exit(1)413#414# cleanup for memory allocation counting415#416del f417del input418del reader419# Memory debug specific420libxml2.cleanupParser()421if libxml2.debugMemory(1) == 0:422 print("OK")...

Full Screen

Full Screen

test_htmlreader.py

Source:test_htmlreader.py Github

copy

Full Screen

1import sys2import unittest3from types import UnicodeType4from robot.parsing.htmlreader import HtmlReader5from robot.utils.asserts import *6VALID_TABLES = [ "Variable", "Setting", "Test Case", "Test Suite", "Keyword" ]7ROW_TEMPLATE = '<tr><td>%s</td><td>%s</td><td>%s</td></tr>'8class PopulatorMock:9 def __init__(self):10 self.tables = {}11 self.current = None12 def start_table(self, header):13 name = header[0]14 if name in VALID_TABLES:15 self.tables[name] = []16 self.current = name17 return True18 else:19 self.current = None20 return False21 def add(self, cells):22 self.tables[self.current].append(cells)23class TestHtmlReader(unittest.TestCase):24 def setUp(self):25 self.reader = HtmlReader()26 self.reader.populator = PopulatorMock()27 def test_initial_state(self):28 self.reader.state = self.reader.IGNORE29 self.reader.feed('<table>')30 assert_equals(self.reader.state, self.reader.INITIAL)31 self.reader.feed('</table>')32 assert_equals(self.reader.state, self.reader.IGNORE)33 def test_start_valid_table(self):34 for name in VALID_TABLES:35 self.reader.feed('<table>')36 self.reader.feed(ROW_TEMPLATE % (name, 'Value 1', 'Value2'))37 assert_equals(self.reader.state, self.reader.PROCESS)38 assert_equals(self.reader.populator.current, name)39 self.reader.feed('</table>')40 assert_equals(self.reader.state, self.reader.IGNORE)41 def test_process_invalid_table(self):42 for name in [ "Foo", "VaribleTable" ]:43 self.reader.feed('<table>')44 self.reader.feed(ROW_TEMPLATE % (name, 'Value 1', 'Value2'))45 assert_equals(self.reader.state, self.reader.IGNORE)46 assert_none(self.reader.populator.current)47 self.reader.feed(ROW_TEMPLATE % ('This', 'row', 'is ignored'))48 assert_equals(self.reader.state, self.reader.IGNORE)49 assert_equals(len(self.reader.populator.tables.values()), 0)50 self.reader.feed('</table>')51 assert_equals(self.reader.state, self.reader.IGNORE)52 def test_br(self):53 inp = ('x<br>y', '1<br />2', '<br><br>')54 exp = ['x\ny', '1\n2', '\n\n']55 for name in VALID_TABLES:56 self.reader.feed('<table>')57 self.reader.feed(ROW_TEMPLATE % (name, 'Value 1', 'Value2'))58 self.reader.feed(ROW_TEMPLATE % inp)59 self.reader.feed('</table>')60 assert_equals(self.reader.populator.tables[name], [ exp ])61 def test_processing(self):62 self._row_processing(ROW_TEMPLATE)63 def test_missing_end_td(self):64 self._row_processing('<tr><td>%s<td>%s</td><td>%s</td></tr>')65 self._row_processing('<tr><td>%s<td>%s<td>%s</tr>')66 def test_missing_end_tr(self):67 self._row_processing('<tr><td>%s<td>%s</td><td>%s</td>')68 def test_extra_end_tr(self):69 self._row_processing('<tr><td>%s<td>%s</td><td>%s</td></tr></tr>')70 def test_missing_start_tr(self):71 self._row_processing('<td>%s<td>%s</td><td>%s</td></tr></tr>')72 def _row_processing(self, row_template):73 for name in VALID_TABLES:74 self.reader.feed('<table>')75 self.reader.feed(row_template % (name, 'Value 1', 'Value2'))76 row_data = [['Just', 'some', 'data'],77 ['here', '', 'for'],78 ['', 'these', 'rows']]79 for data in row_data:80 self.reader.feed(row_template % tuple(data))81 assert_equals(self.reader.state, self.reader.PROCESS)82 self.reader.feed('</table>')83 assert_equals(self.reader.state, self.reader.IGNORE)84 assert_equals(self.reader.populator.tables[name], row_data)85class TestEntityAndCharRefs(unittest.TestCase):86 def setUp(self):87 self.reader = HtmlReader()88 self.reader.handle_data = self._handle_response89 def _handle_response(self, value):90 self.response = value91 def test_handle_entiryrefs(self):92 for inp, exp in [('nbsp', u'\xa0'),93 ('apos', "'"),94 ('tilde', u'\u02dc'),95 ('lt', '<'),96 ('gt', '>'),97 ('amp', '&'),98 ('quot', '"'),99 ('auml', u'\xE4'),100 ('ouml', u'\xF6'),101 ('uuml', u'\xFC'),102 ('aring', u'\xE5'),103 ('ntilde', u'\xF1'),104 ('Auml', u'\xC4'),105 ('Ouml', u'\xD6'),106 ('Uuml', u'\xDC'),107 ('Aring', u'\xC5'),108 ('Ntilde', u'\xD1'),109 ('nabla', u'\u2207'),110 ('ldquo', u'\u201c'),111 ('invalid', '&invalid;')]:112 self.reader.handle_entityref(inp)113 msg = '%s: %r != %r' % (inp, self.response, exp)114 assert_equals(self.response, exp, msg, False)115 def test_handle_charefs(self):116 for inp, exp in [('82', 'R'),117 ('228', u'\xE4'),118 ('xe4', u'\xE4'),119 ('XE4', u'\xE4'),120 ('X2603', u'\u2603'),121 ('invalid', '&#invalid;')]:122 self.reader.handle_charref(inp)123 msg = '%s: %r != %r' % (inp, self.response, exp)124 assert_equals(self.response, exp, msg, False)125class TestEncoding(unittest.TestCase):126 def test_default_encoding(self):127 assert_equals(HtmlReader()._encoding, 'ISO-8859-1')128 def test_encoding_is_read_from_meta_tag(self):129 reader = HtmlReader()130 reader.feed('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />')131 assert_equals(reader._encoding, 'utf-8')132 reader.feed('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">')133 assert_equals(reader._encoding, 'UTF-8')134 def test_valid_http_equiv_is_required(self):135 reader = HtmlReader()136 reader.feed('<meta content="text/html; charset=utf-8" />')137 assert_equals(reader._encoding, 'ISO-8859-1')138 reader.feed('<meta http-equiv="Invalid" content="text/html; charset=utf-8" />')139 assert_equals(reader._encoding, 'ISO-8859-1')140 def test_encoding_is_set_from_xml_preamble(self):141 reader = HtmlReader()142 reader.feed('<?xml version="1.0" encoding="UTF-8"?>')143 assert_equals(reader._encoding, 'UTF-8')144 reader.feed('<?xml encoding=US-ASCII version="1.0"?>')145 assert_equals(reader._encoding, 'US-ASCII')146 def test_encoding_and_entityrefs(self):147 reader = HtmlReader()148 reader.populator = PopulatorMock()149 reader.feed('<meta content="text/html; charset=utf-8" />')150 reader.feed('<table><tr><td>Setting</td></tr>')151 reader.feed('<tr><td>&auml;iti')152 assert_equals(reader.current_cell, [u'\xe4', u'iti'])153 reader.feed('</tr>')154 assert_equals(reader.populator.tables['Setting'][0], [u'\xe4iti'])155if __name__ == '__main__':...

Full Screen

Full Screen

reader.test.js

Source:reader.test.js Github

copy

Full Screen

1// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.2var test = require('tap').test;3///--- Globals4var BerReader;5///--- Tests6test('load library', function(t) {7 BerReader = require('../../lib/index').BerReader;8 t.ok(BerReader);9 try {10 new BerReader();11 t.fail('Should have thrown');12 } catch (e) {13 t.ok(e instanceof TypeError, 'Should have been a type error');14 }15 t.end();16});17test('read byte', function(t) {18 var reader = new BerReader(new Buffer([0xde]));19 t.ok(reader);20 t.equal(reader.readByte(), 0xde, 'wrong value');21 t.end();22});23test('read 1 byte int', function(t) {24 var reader = new BerReader(new Buffer([0x02, 0x01, 0x03]));25 t.ok(reader);26 t.equal(reader.readInt(), 0x03, 'wrong value');27 t.equal(reader.length, 0x01, 'wrong length');28 t.end();29});30test('read 2 byte int', function(t) {31 var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde]));32 t.ok(reader);33 t.equal(reader.readInt(), 0x7ede, 'wrong value');34 t.equal(reader.length, 0x02, 'wrong length');35 t.end();36});37test('read 3 byte int', function(t) {38 var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03]));39 t.ok(reader);40 t.equal(reader.readInt(), 0x7ede03, 'wrong value');41 t.equal(reader.length, 0x03, 'wrong length');42 t.end();43});44test('read 4 byte int', function(t) {45 var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01]));46 t.ok(reader);47 t.equal(reader.readInt(), 0x7ede0301, 'wrong value');48 t.equal(reader.length, 0x04, 'wrong length');49 t.end();50});51test('read 1 byte negative int', function(t) {52 var reader = new BerReader(new Buffer([0x02, 0x01, 0xdc]));53 t.ok(reader);54 t.equal(reader.readInt(), -36, 'wrong value');55 t.equal(reader.length, 0x01, 'wrong length');56 t.end();57});58test('read 2 byte negative int', function(t) {59 var reader = new BerReader(new Buffer([0x02, 0x02, 0xc0, 0x4e]));60 t.ok(reader);61 t.equal(reader.readInt(), -16306, 'wrong value');62 t.equal(reader.length, 0x02, 'wrong length');63 t.end();64});65test('read 3 byte negative int', function(t) {66 var reader = new BerReader(new Buffer([0x02, 0x03, 0xff, 0x00, 0x19]));67 t.ok(reader);68 t.equal(reader.readInt(), -65511, 'wrong value');69 t.equal(reader.length, 0x03, 'wrong length');70 t.end();71});72test('read 4 byte negative int', function(t) {73 var reader = new BerReader(new Buffer([0x02, 0x04, 0x91, 0x7c, 0x22, 0x1f]));74 t.ok(reader);75 t.equal(reader.readInt(), -1854135777, 'wrong value');76 t.equal(reader.length, 0x04, 'wrong length');77 t.end();78});79test('read boolean true', function(t) {80 var reader = new BerReader(new Buffer([0x01, 0x01, 0xff]));81 t.ok(reader);82 t.equal(reader.readBoolean(), true, 'wrong value');83 t.equal(reader.length, 0x01, 'wrong length');84 t.end();85});86test('read boolean false', function(t) {87 var reader = new BerReader(new Buffer([0x01, 0x01, 0x00]));88 t.ok(reader);89 t.equal(reader.readBoolean(), false, 'wrong value');90 t.equal(reader.length, 0x01, 'wrong length');91 t.end();92});93test('read enumeration', function(t) {94 var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20]));95 t.ok(reader);96 t.equal(reader.readEnumeration(), 0x20, 'wrong value');97 t.equal(reader.length, 0x01, 'wrong length');98 t.end();99});100test('read string', function(t) {101 var dn = 'cn=foo,ou=unit,o=test';102 var buf = new Buffer(dn.length + 2);103 buf[0] = 0x04;104 buf[1] = Buffer.byteLength(dn);105 buf.write(dn, 2);106 var reader = new BerReader(buf);107 t.ok(reader);108 t.equal(reader.readString(), dn, 'wrong value');109 t.equal(reader.length, dn.length, 'wrong length');110 t.end();111});112test('read sequence', function(t) {113 var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));114 t.ok(reader);115 t.equal(reader.readSequence(), 0x30, 'wrong value');116 t.equal(reader.length, 0x03, 'wrong length');117 t.equal(reader.readBoolean(), true, 'wrong value');118 t.equal(reader.length, 0x01, 'wrong length');119 t.end();120});121test('anonymous LDAPv3 bind', function(t) {122 var BIND = new Buffer(14);123 BIND[0] = 0x30; // Sequence124 BIND[1] = 12; // len125 BIND[2] = 0x02; // ASN.1 Integer126 BIND[3] = 1; // len127 BIND[4] = 0x04; // msgid (make up 4)128 BIND[5] = 0x60; // Bind Request129 BIND[6] = 7; // len130 BIND[7] = 0x02; // ASN.1 Integer131 BIND[8] = 1; // len132 BIND[9] = 0x03; // v3133 BIND[10] = 0x04; // String (bind dn)134 BIND[11] = 0; // len135 BIND[12] = 0x80; // ContextSpecific (choice)136 BIND[13] = 0; // simple bind137 // Start testing ^^138 var ber = new BerReader(BIND);139 t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence');140 t.equal(ber.length, 12, 'Message length should be 12');141 t.equal(ber.readInt(), 4, 'Message id should have been 4');142 t.equal(ber.readSequence(), 96, 'Bind Request should have been 96');143 t.equal(ber.length, 7, 'Bind length should have been 7');144 t.equal(ber.readInt(), 3, 'LDAP version should have been 3');145 t.equal(ber.readString(), '', 'Bind DN should have been empty');146 t.equal(ber.length, 0, 'string length should have been 0');147 t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)');148 t.equal(ber.readByte(), 0, 'Should have been simple bind');149 t.equal(null, ber.readByte(), 'Should be out of data');150 t.end();151});152test('long string', function(t) {153 var buf = new Buffer(256);154 var o;155 var s =156 '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' +157 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' +158 'Teena Vradmin\'s description.';159 buf[0] = 0x04;160 buf[1] = 0x81;161 buf[2] = 0x94;162 buf.write(s, 3);163 var ber = new BerReader(buf.slice(0, 3 + s.length));164 t.equal(ber.readString(), s);165 t.end();...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var fs = require('fs');3var path = require('path');4var request = require('request');5var async = require('async');6var cheerio = require('cheerio');7var mkdirp = require('mkdirp');8var _ = require('underscore');9var download = require('download-file');10var async = require('async');11var request = require('request');12var fs = require('fs');13var path = require('path');14var async = require('async');15var cheerio = require('cheerio');16var mkdirp = require('mkdirp');17var _ = require('underscore');18var download = require('download-file');19var async = require('async');20var request = require('request');21var fs = require('fs');22var path = require('path');23var async = require('async');24var cheerio = require('cheerio');25var mkdirp = require('mkdirp');26var _ = require('underscore');27var download = require('download-file');28var async = require('async');29var request = require('request');30var fs = require('fs');31var path = require('path');32var async = require('async');33var cheerio = require('cheerio');34var mkdirp = require('mkdirp');35var _ = require('underscore');36var download = require('download-file');37var async = require('async');38var request = require('request');39var fs = require('fs');40var path = require('path');41var async = require('async');42var cheerio = require('cheerio');43var mkdirp = require('mkdirp');44var _ = require('underscore');45var download = require('download-file');46var async = require('async');47var request = require('request');48var fs = require('fs');49var path = require('path');50var async = require('async');51var cheerio = require('cheerio');52var mkdirp = require('mkdirp');53var _ = require('underscore');54var download = require('download-file');55var async = require('async');56var request = require('request');57var fs = require('fs');58var path = require('path');59var async = require('async');60var cheerio = require('cheerio');61var mkdirp = require('mkdirp');62var _ = require('underscore');63var download = require('download-file');64var async = require('async');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var fs = require('fs');3var request = require('request');4var page = wptools.page(url);5page.get(function(err, data) {6 var json = JSON.stringify(data, null, 2);7 fs.writeFile('test.json', json, 'utf-8');8 console.log("File saved");9});10var wptools = require('wptools');11var fs = require('fs');12var request = require('request');13var page = wptools.page(url);14page.get(function(err, data) {15 var json = JSON.stringify(data, null, 2);16 fs.writeFile('test.json', json, 'utf-8');17 console.log("File saved");18});19var wptools = require('wptools');20var fs = require('fs');21var request = require('request');22var page = wptools.page(url);23page.get(function(err, data) {24 var json = JSON.stringify(data, null, 2);25 fs.writeFile('test.json', json, 'utf-8');26 console.log("File saved");27});28var wptools = require('wptools');29var fs = require('fs');30var request = require('request');31var page = wptools.page(url);32page.get(function(err, data) {33 var json = JSON.stringify(data, null, 2);34 fs.writeFile('test.json', json, 'utf-8');35 console.log("File saved");36});37var wptools = require('wptools');38var fs = require('fs');39var request = require('request');40var page = wptools.page(url);41page.get(function(err, data) {42 var json = JSON.stringify(data, null, 2);43 fs.writeFile('test

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var reader = new wptoolkit.Reader();3 console.log(page.title);4});5var wptoolkit = require('wptoolkit');6var writer = new wptoolkit.Writer();7 console.log('done');8});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var reader = require('wptools/lib/reader');3var wiki = wptools.page('Barack Obama');4var reader = reader(wiki);5reader.get('infobox', function(err, data) {6 console.log(data);7});8var wptools = require('wptools');9var reader = require('wptools/lib/reader');10var wiki = wptools.page('Barack Obama');11var reader = reader(wiki);12reader.get('infobox', function(err, data) {13 console.log(data);14});15var wptools = require('wptools');16var reader = require('wptools/lib/reader');17var wiki = wptools.page('Barack Obama');18var reader = reader(wiki);19reader.get('infobox', function(err, data) {20 console.log(data);21});22var wptools = require('wptools');23var reader = require('wptools/lib/reader');24var wiki = wptools.page('Barack Obama');25var reader = reader(wiki);26reader.get('infobox', function(err, data) {27 console.log(data);28});29var wptools = require('wptools');30var reader = require('wptools/lib/reader');31var wiki = wptools.page('Barack Obama');32var reader = reader(wiki);33reader.get('infobox', function(err, data) {34 console.log(data);35});36var wptools = require('wptools');37var reader = require('wptools/lib/reader');38var wiki = wptools.page('Barack Obama');39var reader = reader(wiki);40reader.get('infobox', function(err, data) {41 console.log(data);42});43var wptools = require('wptools');44var reader = require('wptools/lib/reader');45var wiki = wptools.page('Barack Obama');46var reader = reader(wiki);47reader.get('infobox', function(err, data) {48 console.log(data);49});50var wptools = require('wptools');51var reader = require('wptools/lib/reader');

Full Screen

Using AI Code Generation

copy

Full Screen

1const wpt = require('wpt');2const reader = wpt.reader('test.txt');3reader.on('data', (chunk) => {4 console.log(`Received ${chunk.length} bytes of data.`);5});6reader.on('end', () => {7 console.log('There will be no more data.');8});9reader.on('error', (err) => {10 console.log(`Error: ${err}`);11});12const wpt = require('wpt');13const writer = wpt.writer('test.txt');14writer.write('Hello World!', 'utf8', () => {15 console.log('Data written to file');16});17writer.end('This is the end', 'utf8', () => {18 console.log('No more data can be written to file');19});20const wpt = require('wpt');21const reader = wpt.reader('test.txt');22reader.on('data', (chunk) => {23 console.log(`Received ${chunk.length} bytes of data.`);24});25reader.on('end', () => {26 console.log('There will be no more data.');27});28reader.on('error', (err) => {29 console.log(`Error: ${err}`);30});31const wpt = require('wpt');32const writer = wpt.writer('test.txt');33writer.write('Hello World!', 'utf8', () => {34 console.log('Data written to file');35});36writer.end('This is the end', 'utf8', () => {37 console.log('No more data can be written to file');38});39const wpt = require('wpt');

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

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

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful