Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ updates:
schedule:
interval: "weekly"
ignore:
- dependency-name: "kotlin"
versions: [ "2.x" ]
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: "[deps]"
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
branches:
- master
paths:
- ".github/**"
- "src/**"
- "build.gradle"
- "gradle.properties"
- .github/**
- src/**
- build.gradle
- gradle.properties
jobs:
build:
name: Build
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,29 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
distribution: "corretto"
java-version: "17"
cache: "gradle"

- name: Publish artefacts
run: ./gradlew publish
- name: Build and publish
run: ./gradlew clean assemble publish

- name: Release to Maven Central
run: ./gradlew jreleaserDeploy
env:
GITHUB_USER: ${{ secrets.GITHUB_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVEN_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.MAVEN_PASSWORD }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Romanov Alexey
Copyright (c) 2025 Romanov Alexey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Build project](https://github.com/Romanow/skip-method/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/Romanow/skip-method/actions/workflows/build.yml)
[![codecov](https://codecov.io/github/Romanow/skip-method/branch/master/graph/badge.svg?token=RXVXL3NUNS)](https://codecov.io/github/Romanow/skip-method)
[![CI](https://github.com/Romanow/skip-method/actions/workflows/build.yml/badge.svg)](https://github.com/Romanow/skip-method/actions/workflows/build.yml)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Release](https://img.shields.io/github/v/release/Romanow/skip-method?logo=github&sort=semver)](https://github.com/Romanow/skip-method/releases/latest)
[![Codecov](https://codecov.io/gh/Romanow/skip-method/branch/master/graph/badge.svg?token=Cckw6pHLh7)](https://codecov.io/gh/Romanow/skip-method)
[![License](https://img.shields.io/github/license/Romanow/skip-method)](https://github.com/Romanow/skip-method/blob/master/LICENSE)

# Пропуск вызова метода в тестах

Expand All @@ -9,6 +11,25 @@
Сделать исключение вызова конкретных методов (в коде) и заменить их значением по-умолчанию.
Используется для исключения вызова методов при запуске тестов на разных окружениях.

## Подключение

### Maven

```xml
<dependency>
<groupId>ru.romanow-alex</groupId>
<artifactId>skip-method</artifactId>
<version>${skip-method.version}</version>
</dependency>
```

### Gradle

```groovy
testImplementation "ru.romanow-alex:skip-method:$skipMethodVersion"
```


## Конфигурация

Настроить поддержку AspectJ в [gradle](build.gradle):
Expand Down
46 changes: 35 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ plugins {
id "idea"
id "jacoco"
id "maven-publish"
id "org.jetbrains.kotlin.jvm" version "1.9.22"
id "org.jreleaser" version "1.19.0"
id "org.jetbrains.kotlin.jvm" version "1.9.25"
id "org.jlleitschuh.gradle.ktlint" version "12.1.1"
}

[compileKotlin, compileTestKotlin]*.kotlinOptions*.jvmTarget = "17"

ext {
junitVersion = "5.11.0"
junitVersion = "5.13.3"
mockitoVersion = "5.13.0"
assertjVersion = "3.26.3"
aspectjVersion = "1.9.22.1"
Expand Down Expand Up @@ -51,6 +52,10 @@ test {
useJUnitPlatform()
systemProperty "skipOn", findProperty("skipOn")

testLogging {
showStandardStreams = true
}

doFirst {
jvmArgs "--add-opens",
"java.base/java.lang=ALL-UNNAMED",
Expand All @@ -70,9 +75,11 @@ check.dependsOn jacocoTestReport
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = "playwright-page-object"
description = "Page Object pattern for Playwright framework"
name = "skip-method"
description = "Skip method in test"
url = "https://github.com/Romanow/skip-method/"
licenses {
license {
name = "The MIT License"
Expand All @@ -81,22 +88,39 @@ publishing {
}
developers {
developer {
name = "Romanov Alex"
email = "romanowalex@mail.ru"
id = "Romanow"
name = "Romanov Alexey"
email = "romanow.tech@gmail.com"
}
}
scm {
url = "https://github.com/Romanow/playwright-page-object/"
url = "https://github.com/Romanow/skip-method/"
connection = "scm:git:https://github.com/Romanow/skip-method.git"
developerConnection = "scm:git:ssh://github.com/Romanow/skip-method.git"
}
}
}
}
repositories {
maven {
url = uri("https://maven.pkg.github.com/Romanow/playwright-page-object")
credentials {
username = System.getenv("GITHUB_USER")
password = System.getenv("GITHUB_TOKEN")
url = "build/staging-deploy"
}
}
}

jreleaser {
signing {
active = "ALWAYS"
armored = true
}
deploy {
maven {
mavenCentral {
sonatype {
active = "ALWAYS"
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=1.0.0
group=ru.romanow.skip.method
group=ru.romanow-alex
org.gradle.daemon=true
4 changes: 3 additions & 1 deletion src/main/kotlin/ru/romanow/skip/method/SkipMethod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ annotation class SkipMethod(
val skipOn: Array<Environments> = []
) {
enum class Environments {
DEV, STAGE, PROD
DEV,
STAGE,
PROD
}
}

Expand Down