Commit b3cf0034 authored by David Cordero's avatar David Cordero Committed by Carola Nitz

fastlane: Define new lane to run tests

Define a new lane to run the current test suites of the project, and make a few fixes in the tests itself.
parent 05762571
//
// VLCTestLibrary.m
// VLC
//
// Created by Carola Nitz on 9/21/17.
// Copyright © 2017 VideoLAN. All rights reserved.
//
/*****************************************************************************
* VLC_for_IOSTestMenu.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Author: Carola Nitz <caro # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <XCTest/XCTest.h>
@interface VLC_for_IOSTestMenu : XCTestCase
@property (nonatomic, strong) XCUIApplication *application;
@end
@implementation VLC_for_IOSTestMenu
......@@ -18,111 +22,92 @@
[super setUp];
self.continueAfterFailure = YES;
[[[XCUIApplication alloc] init] launch];
self.application = [[XCUIApplication alloc] init];
[self.application launch];
[[XCUIDevice sharedDevice] setOrientation:UIDeviceOrientationFaceUp];
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
if (self.application.navigationBars[@"Welcome"].exists) {
[self.application.navigationBars[@"Welcome"].buttons[@"Done"] tap];
}
}
- (void)testMenuTabAllFiles {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells/*@START_MENU_TOKEN@*/.staticTexts[@"All Files"]/*[[".cells.staticTexts[@\"All Files\"]",".staticTexts[@\"All Files\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
XCTAssertNotNil(app.navigationBars[@"All Files"]);
- (void)testMenuTabAllFiles
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"All Files"] tap];
XCTAssertNotNil(self.application.navigationBars[@"All Files"]);
}
- (void)testMenuTabMusicAlbums {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells/*@START_MENU_TOKEN@*/.staticTexts[@"Music Albums"]/*[[".cells.staticTexts[@\"Music Albums\"]",".staticTexts[@\"Music Albums\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/ tap];
XCTAssertNotNil(app.navigationBars[@"Music Albums"]);
- (void)testMenuTabMusicAlbums
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Music Albums"] tap];
XCTAssertNotNil(self.application.navigationBars[@"Music Albums"]);
}
- (void)testMenuTabTVShows {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"TV Shows"] tap];
XCTAssertNotNil(app.navigationBars[@"TV Shows"]);
- (void)testMenuTabTVShows
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"TV Shows"] tap];
XCTAssertNotNil(self.application.navigationBars[@"TV Shows"]);
}
- (void)testMenuTabLocalNetwork {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"Local Network"] tap];
XCTAssertNotNil(app.navigationBars[@"Local Network"]);
- (void)testMenuTabLocalNetwork
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Local Network"] tap];
XCTAssertNotNil(self.application.navigationBars[@"Local Network"]);
}
- (void)testMenuTabNetworkStream {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"Network Stream"] tap];
XCTAssertNotNil(app.navigationBars[@"Network Stream"]);
- (void)testMenuTabNetworkStream
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Network Stream"] tap];
XCTAssertNotNil(self.application.navigationBars[@"Network Stream"]);
}
- (void)testMenuTabDownloads {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"Downloads"] tap];
XCTAssertNotNil(app.navigationBars[@"Downloads"]);
- (void)testMenuTabDownloads
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Downloads"] tap];
XCTAssertNotNil(self.application.navigationBars[@"Downloads"]);
}
- (void)testMenuTabWifi {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
- (void)testMenuTabWifi
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Sharing via WiFi"] tap];
[app.cells.staticTexts[@"Sharing via WiFi"] tap];
XCTAssertFalse(app.tables.staticTexts[@"Inactive Server"].exists);
XCTAssertFalse(self.application.tables.staticTexts[@"Inactive Server"].exists);
}
- (void)testMenuTabCloudServices {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
- (void)testMenuTabCloudServices
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Cloud Services"] tap];
[app.cells.staticTexts[@"Cloud Services"] tap];
XCTAssertNotNil(app.navigationBars[@"Cloud Services"]);
XCTAssertNotNil(self.application.navigationBars[@"Cloud Services"]);
}
- (void)testMenuTabSettings {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"Settings"] tap];
- (void)testMenuTabSettings
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"Settings"] tap];
XCTAssertNotNil(app.navigationBars[@"Settings"]);
XCTAssertNotNil(self.application.navigationBars[@"Settings"]);
}
- (void)testMenuTabAbout {
XCUIApplication *app = [[XCUIApplication alloc] init];
[app.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[app.cells.staticTexts[@"About VLC for iOS"] tap];
- (void)testMenuTabAbout
{
[self.application.navigationBars[@"All Files"].buttons[@"Open VLC sidebar menu"] tap];
[self.application.cells.staticTexts[@"About VLC for iOS"] tap];
XCTAssertNotNil(app.navigationBars[@"About"]);
XCTAssertNotNil(self.application.navigationBars[@"About"]);
}
@end
//
// VLC_for_iOSTestVideoCodecs.m
// VLC for iOSUITests
//
// Created by Carola Nitz on 9/25/17.
// Copyright © 2017 VideoLAN. All rights reserved.
//
/*****************************************************************************
* VLC_for_iOSTestVideoCodecs.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Author: Carola Nitz <caro # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
#import <XCTest/XCTest.h>
......
......@@ -56,6 +56,14 @@ lane :ci do
)
end
#### Tests ####
desc 'Run Tests'
lane :test do
cocoapods(repo_update: true)
scan(scheme: 'VLC-iOS')
end
#### Private ####
desc 'Bump and commit app version and build number'
......
......@@ -46,11 +46,17 @@ This action does the following:
- Update the changelog from the NEWS file
- Push the version bump
### ci
```
fastlane ci
```
### test
```
fastlane test
```
Run Tests
----
......
workspace "VLC.xcworkspace"
clean true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment