GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kochetkov-ma/qa-tools: Different Tools for Auto Testing

BranchesTags
Open more actions menu

Latest commit

 

History

30 Commits
30 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
config
config
 
 
gradle
gradle
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
lombok.config
lombok.config
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

QA Tools Java Library

Build / Make Release / Publish to OSS

jdk11 gradle junit

Coverage Status

Maven Central

Codacy Badge

checkstyle pmd spotbugs

qa-tools

Different simple tools for auto testing:

  • unit-testing
  • web ui
  • mobile ui
  • api
  • other

Getting

implementation 'ru.iopump.qa:qa-tools:0.2.0'

Possibilities

Selenium element highlighting

WebDriverEventListener to highlight element with which one be interacting now (active element). Use static constructor.

        final WebDriver sourceDriver = new ChromeDriver()
        final EventFiringWebDriver driver = new EventFiringWebDriver(sourceDriver);
        driver.register(HighlighterListener.newSingleThreadHighlighterListener());

Also you can register this event handler in com.codeborne.selenide via WebDriverRunner

Publishing html page for web testing and unit testing on localhost

If you want check you Page Object or you want provide simple html page on localhost in your unit (integration) tests you can use this simplest and fastest single html page http server from JDK.

        LocalSimpleHtmlServer server = LocalSimpleHtmlServer.of(8080, "/");
        server.publish("<!DOCTYPE html><html><body>test</body></html>");
        server.close()      

or in Junit as test rule

        @Rule
        public LocalSimpleHtmlServer.TestHtmlServer server = LocalSimpleHtmlServer.of(8080, "/")
            .asTestRule("<!DOCTYPE html><html><body>test</body></html>");      

WithValue interface

If you have some class with any value field especially String type just implement WithValue interface.
And you will get very convenient method ru.iopump.qa.support.api.WithValue.hasValue (see javadoc).
This smart small method can equals every types of values especially String type with ignore case, also it execute smart cast objectValue or expectedValue to String if any of them is String type.

Utilities

ClassUtil

Provide several JDK's methods with a null-safe behavior.

EnumUtil

  • create your enum implemented WithValue<String>
    @AllArgsConstructor
    @Getter
    private enum EnumTmp implements WithValue<String> {
        ONE("one_value"), TWO("two_value"), THREE("three_value");
        private final String value;
    }
  • find enum constants by String value and don't worry about letter's case or get clear exception with very useful message
EnumTmp result = EnumUtil.getByValue(EnumTmp.class, "ONE_VALUE")
assert result == EnumTmp.ONE
  • you may change generic type to any other and use it
  • also you may find enum by its name
EnumTmp result = EnumUtil.getByName(EnumTmp.class, "two")
assert result == EnumTmp.TWO

FileUtil

ReflectionUtil

ResourceUtil

Str

StreamUtil

VarUtil

Merge environment and system variables.

        /* get */
        Optional<String> envOrSysProp = VarUtil.get("OS");
        assertThat(envOrSysProp).isNotEmpty();
        /* getOrDefault */
        String envOrSysPropOrDefault = VarUtil.getOrDefault("NOT_EXISTS", "DEFAULT_VALUE") // can be null
        assertThat(VarUtil.getOfDefault("NOT_EXISTS", "DEFAULT_VALUE")).isEqualTo("DEFAULT_VALUE");

About

Different Tools for Auto Testing

Topics

actionscentralgithubgradlehighlighthighlight-elementhtmlhtml-pagehttp-serverjava11seleniumutilities

Resources

Readme
Apache-2.0 license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.