Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, functions, variables, folder names, filenames, file extensions, pathnames, dummy URLs and user input. Here is an example: "Every HTML document will be contained inside an <html>
element."
A block of code is set as follows:
const productId = config.productToTestId; const productDiv = await this.page.$(`[data-test-product-id="${productId}"]`); const stockElement = await productDiv.$('[data-test-stock]'); const priceElement = await productDiv.$('[data-test-price]');
Any command-line input or output is written as follows:
~ % /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --remote-debugging-port=9222 --crash-dumps-dir=/tmp
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "When you call page.click
, that function will return a Promise."
Tips or important notes
Appear like this.