This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setting auto-switch node version based on .nvmrc | |
# place this after nvm initialization! | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" | |
local nvmrc_path="$(nvm_find_nvmrc)" | |
if [ -n "$nvmrc_path" ]; then | |
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test } from '@playwright/test'; | |
/** | |
* Updates exsiting annotation or creates new one for current test | |
* | |
* @throws {Error} if called outside of test or before/after hooks | |
*/ | |
export function setAnnotation(annotation: { | |
type: string; | |
description: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nvm initialization | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
# setting auto-switch node version based on .nvmrc | |
# place this after nvm initialization! | |
autoload -U add-zsh-hook | |
load-nvmrc() { | |
local node_version="$(nvm version)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { expect as baseExpect } from "@playwright/test"; | |
import type { APIResponse } from "@playwright/test"; | |
export const expect = baseExpect.extend({ | |
async responseToHaveErrorStatusCode( | |
requestFunction: () => Promise<APIResponse>, | |
expected: number | |
) { | |
const assertionName = "responseToHaveErrorStatusCode"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test } from '@playwright/test'; | |
/** | |
* Decorator that wraps a function with a Playwright test step. | |
* Used for reporting purposes. | |
* | |
* @example | |
``` | |
import { step } from './step_decorator'; | |
class MyTestClass { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { | |
FullResult, Reporter, TestCase, TestResult, | |
} from '@playwright/test/types/testReporter'; | |
class PlaywrightSlackReporter implements Reporter { | |
allResults: Array<{ test: TestCase, result: TestResult }>; | |
constructor(private conf: { enabled: boolean, webhookUrl: string }) { | |
this.conf = conf; | |
this.allResults = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { browser } from 'protractor'; | |
/** | |
* This function tries to highlight exact point at webpage where click was failed, | |
* by placing special red square into failed coordinate. | |
* So allure screenshots will show exact failing location | |
* @param error exception object | |
*/ | |
export async function drawClickPointAttempt(error: Error) { | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs'; | |
import * as path from 'path'; | |
import { URL } from 'url'; | |
import got from 'got'; | |
import FormData from 'form-data'; | |
async function compress(srcFolder: string, zipFilePath: string) { | |
const archiver = require('archiver'); | |
const targetBasePath = path.dirname(zipFilePath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @url https://github.com/kochetkov-ma/allure-server | |
*/ | |
const got = require('got') | |
const fs = require('fs'); | |
const FormData = require('form-data'); | |
const baseUrl = new URL(`http://93.126.97.71:5001`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use http://93.126.97.71:10082/mp3-players to simplify these tests. Mp3 players does not have custom params on details page. | |
// bonus points: | |
// - use preconditions | |
// - use dataprovider | |
describe('Items', function () { | |
// You must be logged in to use wishlist | |
it('can be added to wishlist', function () { |
NewerOlder