Update tests to work with latest tooling

This commit is contained in:
Steve Sanderson
2017-05-17 10:43:20 +01:00
parent 3390d75528
commit cd240907f8
3 changed files with 90 additions and 97 deletions

View File

@@ -31,7 +31,7 @@ artifacts:
# - ps: .\build.ps1
clone_depth: 1
test_script:
- dotnet restore ./src
- dotnet restore
- npm install -g selenium-standalone
- selenium-standalone install
# The nosys flag is needed for selenium to work on Appveyor

View File

@@ -5,17 +5,14 @@ import { generateProjectSync } from './util/yeoman';
import { AspNetProcess, AspNetCoreEnviroment, defaultUrl, publishProjectSync } from './util/aspnet';
import { getValue, getCssPropertyValue } from './util/webdriverio';
// Currently we test both 'csproj' and 'project.json' project types. Eventually we'll only need csproj.
['csproj', 'projectjson'].forEach(toolingType => {
// First, generate a new project using the locally-built generator-aspnetcore-spa
// Do this outside the Mocha fixture, otherwise Mocha will time out
const appDir = path.resolve(__dirname, '../generated/angular', toolingType);
const appDir = path.resolve(__dirname, '../generated/angular');
const publishedAppDir = path.resolve(appDir, './bin/Release/published');
if (!process.env.SKIP_PROJECT_GENERATION) {
generateProjectSync(appDir, {
framework: 'angular-2',
framework: 'angular',
name: 'Test App',
sdkVersion: toolingType === 'projectjson' ? '1.0.0-preview2-1-003177' : '1.0.0-preview3-004056',
tests: false
});
publishProjectSync(appDir, publishedAppDir);
@@ -98,9 +95,6 @@ import { getValue, getCssPropertyValue } from './util/webdriverio';
});
describe('Angular template: production mode', () => {
// csproj tooling takes the assembly name from <name>.csproj, whereas project.json takes it from the directory name
const assemblyName = toolingType === 'csproj' ? 'TestApp.dll' : 'projectjson.dll';
AspNetProcess.RunInMochaContext(publishedAppDir, AspNetCoreEnviroment.production, assemblyName);
AspNetProcess.RunInMochaContext(publishedAppDir, AspNetCoreEnviroment.production, 'TestApp.dll');
testBasicNavigation();
});
});

View File

@@ -9,7 +9,6 @@ const yoPackageDirAbsolute = path.resolve('./node_modules/yo');
export interface GeneratorOptions {
framework: string;
name: string;
sdkVersion?: string;
tests?: boolean;
}