We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 1 column, instead of 2. in line 3.
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
+-----------+-----------------------------------+-----------------------------------+----------------------------+----------------------------+ | |
| Tool | Overview | Key Features | Ideal Use Cases | Limitations | | |
+-----------+-----------------------------------+-----------------------------------+----------------------------+----------------------------+ | |
| JUnit | Staple in Java testing, known | Basic pass/fail reporting. | Straightforward unit | Lacks advanced reporting | | |
| | for simplicity and efficiency. | | testing in Java. | and analytics. | | |
+-----------+-----------------------------------+-----------------------------------+----------------------------+----------------------------+ | |
| TestNG | Advanced version of JUnit, | Wide range of tests, including | Complex Java projects | More complex setup; may | | |
| | mo |
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
public interface TestObject { | |
void performTest(); | |
} | |
public class TestObjectFactory { | |
public static TestObject createTestObject(String type) { | |
if (type.equals("TypeA")) { | |
return new TestObjectA(); | |
} else if (type.equals("TypeB")) { | |
return new TestObjectB(); |
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
public class WebDriverSingleton { | |
private static WebDriver instance; | |
private WebDriverSingleton() { | |
// Private constructor to prevent external instantiation | |
} | |
public static WebDriver getInstance() { | |
if (instance == null) { | |
// Create a new WebDriver instance |
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
public class LoginPage { | |
private WebDriver driver; | |
// Web elements | |
private By usernameInput = By.id("username"); | |
private By passwordInput = By.id("password"); | |
private By loginButton = By.id("loginButton"); | |
public LoginPage(WebDriver driver) { | |
this.driver = driver; | |
} |
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
public class LoginPage { | |
private WebDriver driver; | |
// Web elements | |
private By usernameInput = By.id("username"); | |
private By passwordInput = By.id("password"); | |
private By loginButton = By.id("loginButton"); | |
public LoginPage(WebDriver driver) { | |
this.driver = driver; | |
} |
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
// Store contract remotely | |
publisher := dsl.Publisher{} | |
err = publisher.Publish(types.PublishRequest{ | |
PactURLs: []string{"../client/pacts/sample_consumer-sample_provider.json"}, | |
PactBroker: "https://pen.pactflow.io/", //link to your remote Contract broker | |
BrokerToken: "xxx", //your PactFlow token | |
ConsumerVersion: "1.0.0", | |
Tags: []string{"1.0.0", "latest"}, | |
}) | |
if err != nil { |
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
type Car struct { | |
ID string `json:"id"` | |
Title string `json:"title"` | |
Color string `json:"color"` | |
} | |
var Cars = []Car{ | |
{ID: "1", Title: "BMW", Color: "Black"}, | |
{ID: "2", Title: "Tesla", Color: "Red"}, | |
} |
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
_, err := pact.VerifyProvider(t, types.VerifyRequest{ | |
ProviderBaseURL: "http://127.0.0.1:8080", //provider's URL | |
BrokerURL: "https://pen.pactflow.io", //link to your remote Contract broker | |
BrokerToken: "xxx", //your PactFlow token | |
PublishVerificationResults: true, | |
ProviderVersion: "1.0.0", | |
}) | |
if err != nil { | |
t.Fatal(err) |
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
publisher := dsl.Publisher{} | |
err := publisher.Publish(types.PublishRequest{ | |
PactURLs: []string{"../client/pacts/sample_consumer-sample_provider.json"}, | |
PactBroker: "https://pen.pactflow.io/", //link to your remote Contract broker | |
BrokerToken: "xxx", //your PactFlow token | |
ConsumerVersion: "1.0.0", | |
Tags: []string{"1.0.0", "latest"}, | |
}) | |
if err != nil { | |
t.Fatal(err) |
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
func startProvider() { | |
main() | |
} | |
func TestServerPact_Verification(t *testing.T) { | |
go startProvider() | |
var dir, _ = os.Getwd() | |
var pactDir = fmt.Sprintf("%s/../client/pacts", dir) |
NewerOlder