Skip to content

Instantly share code, notes, and snippets.

View nadvolod's full-sized avatar
🏖️
Just living the good life

Nikolay Advolodkin nadvolod

🏖️
Just living the good life
View GitHub Profile
@nadvolod
nadvolod / guidelines.md
Last active July 16, 2025 20:13
Prompt guidelines for vibe coding

Project Development Guidelines

Automated Testing Guidelines

Test Scope

  • Only create positive tests unless explicitly requested to add negative tests or edge cases
  • Focus on happy path scenarios that verify features work as expected
  • One positive test per feature is sufficient unless more comprehensive testing is specifically requested

Test Execution

@nadvolod
nadvolod / data-driven.spec.ts
Last active May 21, 2025 19:07
Data driven testing w/ pw
// ❌ duplicate test name
for (const user of testUsers) {
test(`GET users`, async({request}) => {
const response = await request.get(`https://jsonplaceholder.typicode.com/posts/${user.id}`)
// assertions here
})
}
// ✅ each test within a describe block has a unique name
for (const user of testUsers) {
@nadvolod
nadvolod / data-driven.ts
Last active May 21, 2025 11:38
Data-driven test using Playwright
// Data-driven test that runs once for each data entry
test.describe('Login functionality', () => {
test(`Login as ${user.username}`, async ({ page }) => {
// Navigate to login page
await page.goto('https://example.com/login');
// Fill the form
//{ username: 'standardUser', password: 'secret1', expectedPage: '/dashboard' }
//{ username: 'adminUser', password: 'admin123', expectedPage: '/admin' },
await page.fill('input[name="username"]', user.username);
(base) nikks-mbp:platform nikolay$ pnpm create wdio@latest .
-:...........................-:.
+ +
`` + `...` `...` + `
./+/ + .:://:::` `::///::` ` + ++/.
.+oo+ + /:+ooo+-/ /-+ooo+-/ ./ + +oo+.
-ooo+ + /-+ooo+-/ /-+ooo+-/ .: + +ooo.
-+o+ + `::///:-` `::///::` + +o+-
``. /. ````` ````` .: .``
<AccordionEntry label="Error" variant="error">
<div className="whitespace-pre-wrap break-words">
{testResult.error.message}
</div>
</AccordionEntry>
@nadvolod
nadvolod / .gitconfig
Created February 16, 2025 17:24
My favorite .gitconfig aliases
# Status - quick overview
git config --global alias.st status
git config --global alias.s "status -s"
# Committing
git config --global alias.co commit
git config --global alias.cm "commit -m"
git config --global alias.ca "commit --amend"
# Branch management
package com.saucelabs.saucebindings.junit5.examples.without;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.extension.ExtensionContext;
@nadvolod
nadvolod / TestOrderDependency.java
Created February 20, 2024 13:07
Test ordering problem
// Problem: Test order dependency
@FixMethodOrder(MethodSorters.NAME_ASCENDING) // This ensures the test methods are executed in lexicographical order by their names
public class TestOrderDependency {
private static WebDriver driver;
@BeforeClass
public static void setUpClass() throws Exception {
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browserName", "chrome");
package com.saucelabs.saucebindings.junit4.examples;
public class ConditionTester {
private boolean actionDone;
public boolean option1(boolean conditionA, boolean conditionB) {
if (!conditionA) {
actionDone = true; // Represents "Another action"
return actionDone;
}
@nadvolod
nadvolod / DataFactory.ts
Created September 3, 2023 19:07
Using a Data Factory with Playwright and TypeScript
interface UserData {
username: string;
password: string;
}
interface AddressData {
street: string;
city: string;
zipCode: string;
}