RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/tugkanboz/awesome-cursorrules

Cursor rule

example-structures/selenium-python/.cursor/rules/framework-architecture.mdc

Selenium + pytest framework architecture — configuration, fixtures, and dependency management

Cursor rules

Quality

93/100

Scores the file, not the repository.

Length

344 words

10 headings · 4 code blocks

Repository

18

— · pushed 0 days ago

Last changed

2 days ago

First indexed 2 days ago.
tugkanboz/awesome-cursorrules/example-structures/selenium-python/.cursor/rules/framework-architecture.mdcRawGitHub
1---
2description: Selenium + pytest framework architecture — configuration, fixtures, and dependency management
3globs: **/conftest.py,**/pytest.ini,**/requirements.txt,**/pyproject.toml
4alwaysApply: false
5---
6# Selenium Python Framework Architecture
7 
8## Modern Framework Foundation
9- **pytest Framework**: Leverage pytest's powerful fixture system and plugin ecosystem
10- **Modular Architecture**: Separate concerns with clear package structure
11- **Configuration Management**: Environment-specific settings with proper inheritance
12- **Dependency Management**: Pinned versions with regular security updates
13 
14## Project Structure Best Practices
15```
16selenium-project/
17├── tests/
18│ ├── conftest.py # Global pytest configuration
19│ ├── pages/ # Page Object Models
20│ ├── specs/ # Test specifications
21│ ├── utils/ # Helper utilities
22│ └── data/ # Test data files
23├── config/
24│ ├── environments/ # Environment configurations
25│ └── browsers/ # Browser configurations
26├── reports/ # Test execution reports
27├── logs/ # Application logs
28├── requirements.txt # Python dependencies
29└── pytest.ini # pytest configuration
30```
31 
32## pytest Configuration Excellence
33```python
34# conftest.py - Global configuration
35import pytest
36import os
37from selenium import webdriver
38from selenium.webdriver.chrome.options import Options as ChromeOptions
39from webdriver_manager.chrome import ChromeDriverManager
40 
41def pytest_addoption(parser):
42 """Command line options for flexible test execution."""
43 parser.addoption("--browser", action="store", default="chrome")
44 parser.addoption("--headless", action="store_true", default=False)
45 parser.addoption("--env", action="store", default="dev")
46 parser.addoption("--parallel", action="store", default="1")
47 
48@pytest.fixture(scope="session")
49def browser_config(request):
50 """Browser configuration based on command line arguments."""
51 return {
52 "browser": request.config.getoption("--browser"),
53 "headless": request.config.getoption("--headless"),
54 "environment": request.config.getoption("--env")
55 }
56```
57 
58## Environment Management
59```python
60# Environment-specific configuration loading
61import yaml
62import os
63from typing import Dict, Any
64 
65class ConfigManager:
66 """Centralized configuration management."""
67
68 def __init__(self, environment: str = "dev"):
69 self.environment = environment
70 self.config = self._load_config()
71
72 def _load_config(self) -> Dict[str, Any]:
73 """Load environment-specific configuration."""
74 config_file = f"config/environments/{self.environment}.yaml"
75
76 if not os.path.exists(config_file):
77 raise FileNotFoundError(f"Configuration file not found: {config_file}")
78
79 with open(config_file, 'r') as f:
80 config = yaml.safe_load(f)
81
82 # Validate required keys
83 required_keys = ["base_url", "timeouts", "credentials"]
84 for key in required_keys:
85 if key not in config:
86 raise KeyError(f"Missing required configuration: {key}")
87
88 return config
89
90 def get(self, key: str, default=None):
91 """Get configuration value with dot notation support."""
92 keys = key.split('.')
93 value = self.config
94
95 for k in keys:
96 if isinstance(value, dict) and k in value:
97 value = value[k]
98 else:
99 return default
100
101 return value
102```
103 
104## Dependency Management
105```ini
106# requirements.txt - Pinned versions for stability
107selenium==4.15.0
108pytest==7.4.0
109pytest-html==4.1.1
110pytest-xdist==3.3.1
111webdriver-manager==4.0.1
112pyyaml==6.0.1
113allure-pytest==2.13.2
114python-dotenv==1.0.0
115 
116# Development dependencies
117black==23.9.1
118flake8==6.1.0
119mypy==1.6.0
120```
121 

Commands it names

  • pytest==7.4.0
  • pytest-html==4.1.1
  • pytest-xdist==3.3.1
  • python-dotenv==1.0.0
  • black==23.9.1
  • mypy==1.6.0

Sections

  • Selenium Python Framework Architecture
  • Modern Framework Foundation
  • Project Structure Best Practices
  • pytest Configuration Excellence
  • conftest.py - Global configuration
  • Environment Management
  • Environment-specific configuration loading
  • Dependency Management
  • requirements.txt - Pinned versions for stability
  • Development dependencies

What it covers

setuptestlint-formatcode-stylearchitecturetesting-strategydependencies

Glob targeting

  • **/conftest.py
  • **/pytest.ini
  • **/requirements.txt
  • **/pyproject.toml

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
tugkanboz
Language
—
License
—
Archived
no

All configs in this repo

Also in tugkanboz/awesome-cursorrules

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
tugkanboz/awesome-cursorrulesexample-structures/cypress/.cursor/rules/api-testing.mdc · 18Cursor rulesunclassifiedtesttesting-strategyapi58/1002 days ago
tugkanboz/awesome-cursorrulesexample-structures/cypress/.cursor/rules/testing-fundamentals.mdc · 18Cursor rulesunclassifiedtestarchtesting-strategysecurity+262/1002 days ago
tugkanboz/awesome-cursorrulesexample-structures/next-js/.cursor/rules/app-router-patterns.mdc · 18Cursor rulesunclassifiedstyleapido-not65/1002 days ago
tugkanboz/awesome-cursorrulesexample-structures/react-typescript/.cursor/rules/component-development.mdc · 18Cursor rulesunclassifiedteststylearchtypes+158/1002 days ago
tugkanboz/awesome-cursorrulesexample-structures/selenium-python/.cursor/rules/page-object-patterns.mdc · 18Cursor rulesunclassifiedui54/1002 days ago
tugkanboz/awesome-cursorrulesexample-structures/selenium-python/.cursor/rules/test-patterns.mdc · 18Cursor rulesunclassifiedteststylearchtesting-strategy+166/1002 days ago
tugkanboz/awesome-cursorrulesframeworks/cypress/.cursor/rules/cypress-excellence.mdc · 18Cursor rulesunclassifiedtesttesting-strategysecurityperformance+158/1002 days ago
tugkanboz/awesome-cursorrulesrules/appium-mobile-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedteststylearchperformance+256/1002 days ago
tugkanboz/awesome-cursorrulesrules/cypress-javascript-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedtestlint-formatstylearch+459/1002 days ago
tugkanboz/awesome-cursorrulesrules/k6-performance-test-framework/.cursorrules · 18.cursorrulesunclassifiedsetupteststylearch+256/1002 days ago
tugkanboz/awesome-cursorrulesrules/playwright-javascript-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedtestlint-formatstylearch+359/1002 days ago
tugkanboz/awesome-cursorrulesrules/restassured-java-framework/.cursorrules · 18.cursorrulesunclassifiedteststylearchsecurity+456/1002 days ago
tugkanboz/awesome-cursorrulesrules/selenium-net-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedteststylearchdeployment+156/1002 days ago
tugkanboz/awesome-cursorrulesrules/selenium-python-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedtestlint-formatstylearch+359/1002 days ago
tugkanboz/awesome-cursorrulesrules/vitest-javascript-unit-test-framework/.cursorrules · 18.cursorrulesunclassifiedsetupteststylearch+560/1002 days ago
tugkanboz/awesome-cursorrulesrules/webdriverio-javascript-test-automation-framework/.cursorrules · 18.cursorrulesunclassifiedtestlint-formatstylearch+469/1002 days ago
Diff against example-structures/cypress/.cursor/rules/api-testing.mdc Diff against example-structures/cypress/.cursor/rules/testing-fundamentals.mdc Diff against example-structures/next-js/.cursor/rules/app-router-patterns.mdc Diff against example-structures/react-typescript/.cursor/rules/component-development.mdc Diff against example-structures/selenium-python/.cursor/rules/page-object-patterns.mdc Diff against example-structures/selenium-python/.cursor/rules/test-patterns.mdc Diff against frameworks/cypress/.cursor/rules/cypress-excellence.mdc Diff against rules/appium-mobile-test-automation-framework/.cursorrules Diff against rules/cypress-javascript-test-automation-framework/.cursorrules Diff against rules/k6-performance-test-framework/.cursorrules Diff against rules/playwright-javascript-test-automation-framework/.cursorrules Diff against rules/restassured-java-framework/.cursorrules Diff against rules/selenium-net-test-automation-framework/.cursorrules Diff against rules/selenium-python-test-automation-framework/.cursorrules Diff against rules/vitest-javascript-unit-test-framework/.cursorrules Diff against rules/webdriverio-javascript-test-automation-framework/.cursorrules
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack