Gwen

Library for specifying acceptance criteria in tests in a Given-When-Then format

Лицензия

Лицензия

Группа

Группа

com.shazam
Идентификатор

Идентификатор

gwen
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Gwen
Library for specifying acceptance criteria in tests in a Given-When-Then format
Ссылка на сайт

Ссылка на сайт

http://github.com/shazam/gwen
Система контроля версий

Система контроля версий

http://github.com/shazam/gwen

Скачать gwen

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.shazam/gwen/ -->
<dependency>
    <groupId>com.shazam</groupId>
    <artifactId>gwen</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.shazam/gwen/
implementation 'com.shazam:gwen:1.0.2'
// https://jarcasting.com/artifacts/com.shazam/gwen/
implementation ("com.shazam:gwen:1.0.2")
'com.shazam:gwen:jar:1.0.2'
<dependency org="com.shazam" name="gwen" rev="1.0.2">
  <artifact name="gwen" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.shazam', module='gwen', version='1.0.2')
)
libraryDependencies += "com.shazam" % "gwen" % "1.0.2"
[com.shazam/gwen "1.0.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Gwen

Gwen is a simple library that allows writing acceptance tests in a Given-When-Then syntax.

Using Gwen, we can transform a very verbose and implementation specific test like this:

public void testNotGonnaTellYou() {
    final Instrumentation instrumentation = getInstrumentation();
    final Context targetContext = instrumentation.getTargetContext();
 
    File cacheDir = targetContext.getCacheDir();
    try {
        File file1 = File.createTempFile("file1", "txt", cacheDir);
        File file2 = File.createTempFile("file2", "txt", cacheDir);
    } catch (IOException e) {
        e.printStackTrace();
        Assert.fail("Failed to create files " + e.getMessage());
    }
 
    Intent intent = new Intent(targetContext, DirectoryBrowserActivity.class);
    intent.setData(Uri.parse(cacheDir.getAbsolutePath()));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    targetContext.startActivity(intent);
 
    final Solo solo = new Solo(instrumentation);
    final boolean file1Displayed = solo.searchText("file1.txt");
    final boolean file2Displayed = solo.searchText("file2.txt");
    if (!file1Displayed || !file2Displayed) {
        Assert.fail("Activity did not display files");
    }
}

into a readable, reusable, extensible and maintainable test like this:

public void testDisplaysDirectoryContents() {
    given(directory).contains(SOME_FILES);
     
    when(user).isViewing(directory);
     
    then(user).canSee(THESE_FILES);
}

License

Apache v2.0

com.shazam

Shazam

Версии библиотеки

Версия
1.0.2