-
-
Save RainerW/1043040 to your computer and use it in GitHub Desktop.
System Test Patterns
This file contains 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.seitenbau.demo.systemtest; | |
import static com.seitenbau.assertions.Assertions.assertThat; | |
import javax.inject.Inject; | |
import org.junit.Test; | |
interface WorkDelegate<T> { | |
void doWork(T target); | |
} | |
public class CashPointSystemTest extends SystemTest { | |
@Inject CashPointForm cashPointForm; | |
@Inject PositionTable positionTable; | |
WorkDelegate<CashPointForm> papier1=new WorkDelegate<CashPointForm>{ | |
void doWork(CashPointForm target) { | |
target.enterBasarNumber("100"); | |
target.enterPrice("22,50"); | |
} | |
} | |
@Test public void addTwoArticlesIntoTheCart() throws Exception { | |
cashPointForm.open(); | |
cashPointForm.fillFields( papier ); | |
cashPointForm.clickAdd(); | |
cashPointForm.enterBasarNumber("101"); | |
cashPointForm.enterPrice("23,50"); | |
cashPointForm.clickAdd(); | |
assertThat(cashPointForm.getSumme()).isEqualTo("46,00"); | |
assertThat(positionTable.getRow(1).getBasarNumber()).isEqualTo("100"); | |
assertThat(positionTable.getRow(1).getSeller()).isEqualTo("Test Kunde"); | |
assertThat(positionTable.getRow(1).getPrice()).isEqualTo("+22,50 Euro"); | |
assertThat(positionTable.getRow(2).getBasarNumber()).isEqualTo("101"); | |
assertThat(positionTable.getRow(2).getSeller()).isEqualTo(""); | |
assertThat(positionTable.getRow(2).getPrice()).isEqualTo("+23,50 Euro"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment