This file contains hidden or 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
{ | |
"WebDriver": { | |
"Type": "remote", | |
"Chrome": { | |
"Headless": "true" | |
}, | |
"Remote": { | |
"HubUrl": "http://localhost:4444/wd/hub" | |
} | |
}, |
This file contains hidden or 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
def dockerArtifactoryRegistry = "your-docker-registry-here" | |
def timestamp = new Date().format("MMddHHmmss", TimeZone.getTimeZone('UTC')) | |
pipeline { | |
agent { | |
node { | |
label 'docker' | |
customWorkspace "automated-ui-tests" | |
} | |
} |
This file contains hidden or 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
namespace AutomatedUiTests.Pages | |
{ | |
public abstract class BasePage | |
{ | |
public string Url => WebDriver.Url; | |
public void Close() | |
{ | |
WebDriver.Close(); | |
} |
This file contains hidden or 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
using System; | |
namespace AutomatedUiTests.Components | |
{ | |
public interface IComponent | |
{ | |
void WaitFor(TimeSpan timeSpan); | |
void WaitUntil(Func<bool> condition, int timeoutValue); | |
void Hover(); | |
} |
This file contains hidden or 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
using System.IO; | |
using Gauge.CSharp.Lib.Attribute; | |
using Microsoft.Extensions.Configuration; | |
using OpenQA.Selenium; | |
namespace AutomatedUiTests | |
{ | |
public class TestContext | |
{ | |
public static IConfiguration Configuration { get; private set; } |
This file contains hidden or 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
version: '3.7' | |
services: | |
web-app: | |
container_name: web-app-${DOCKER_SUFFIX} | |
image: <Path to your app's docker image> | |
networks: | |
- automated-ui-tests | |
# Include any other components of your application here |
This file contains hidden or 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
describe('TodosComponent', () => { | |
let testHarness: TestHarness<TodosComponent>; | |
beforeEach(async () => { | |
await setupTestModule(TodosTestModule); | |
testHarness = createTestHarness(TodosComponent); | |
}); | |
it('should create', () => { | |
expect(testHarness.hasComponentCreated).toBeTruthy(); |
This file contains hidden or 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
export class TestHarness<T> { | |
constructor(public component: T, public fixture: ComponentFixture<Component>) { } | |
get hasComponentCreated() { | |
return !!this.component; | |
} | |
detectChanges() { | |
this.fixture.detectChanges(); | |
} |
This file contains hidden or 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
export function setupTestModule<T>(moduleType: Type<T>, providers: any[] = []) { | |
return TestBed.configureTestingModule({ | |
imports: [ | |
moduleType | |
], | |
providers: providers | |
}) | |
.compileComponents(); | |
} |
This file contains hidden or 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
@NgModule({ | |
declarations: [ | |
DashboardComponent | |
], | |
imports: [ | |
CommonModule, | |
TodosTestModule | |
], | |
providers: [ | |
{ provide: DashboardService, useClass: DashboardServiceMock } |
NewerOlder