- 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
This file contains hidden or 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
// ❌ 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) { |
This file contains hidden or 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
// 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); |
This file contains hidden or 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
(base) nikks-mbp:platform nikolay$ pnpm create wdio@latest . | |
-:...........................-:. | |
+ + | |
`` + `...` `...` + ` | |
./+/ + .:://:::` `::///::` ` + ++/. | |
.+oo+ + /:+ooo+-/ /-+ooo+-/ ./ + +oo+. | |
-ooo+ + /-+ooo+-/ /-+ooo+-/ .: + +ooo. | |
-+o+ + `::///:-` `::///::` + +o+- | |
``. /. ````` ````` .: .`` |
This file contains hidden or 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
<AccordionEntry label="Error" variant="error"> | |
<div className="whitespace-pre-wrap break-words"> | |
{testResult.error.message} | |
</div> | |
</AccordionEntry> |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
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; |
This file contains hidden or 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
// 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"); |
This file contains hidden or 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
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; | |
} |
This file contains hidden or 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
interface UserData { | |
username: string; | |
password: string; | |
} | |
interface AddressData { | |
street: string; | |
city: string; | |
zipCode: string; | |
} |
NewerOlder