Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic sample tests and test generation. #823

Open
wants to merge 63 commits into
base: vnext
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
309f4c4
Add initial sample tests and test generation.
skrustev Oct 1, 2024
339d240
Move test generation to test project.
skrustev Oct 1, 2024
9a11c9c
Optimize generated tests using test data.
skrustev Oct 3, 2024
6b20777
Remove test generation and use custom enumerator for provided dynamic…
skrustev Oct 3, 2024
45c7246
Add azure pipeline definition for running tests.
skrustev Oct 8, 2024
e3267aa
Try to fix info task
skrustev Oct 8, 2024
20112b9
Update artifact name.
skrustev Oct 8, 2024
07b6cd4
Use speific triggered pipeline artifact.
skrustev Oct 8, 2024
197174c
Small fix in path and namings.
skrustev Oct 9, 2024
f20211d
Try to fix paths.
skrustev Oct 9, 2024
c1f22ca
Fix missing variable ref symbo.l.
skrustev Oct 9, 2024
f86c5d7
Try to clone repo in specific folder with name.
skrustev Oct 9, 2024
576ae96
Use workspace dirs due to checkout task limitation.
skrustev Oct 9, 2024
fec79e9
Try relative path maybe.
skrustev Oct 9, 2024
0bff851
Try to replace packaga references.
skrustev Oct 9, 2024
df35c9a
Try another script prefix.
skrustev Oct 9, 2024
42b93ef
Fix indexing of package references.
skrustev Oct 9, 2024
fb36f58
Try with a single item set.
skrustev Oct 9, 2024
87c478c
Test replace package name.
skrustev Oct 9, 2024
841a244
Add replace for server as well.
skrustev Oct 9, 2024
af92efc
Fix server path.
skrustev Oct 9, 2024
687cd33
Remove log for script.
skrustev Oct 9, 2024
f5c5f00
Sync folder paths for dependencies.
skrustev Oct 9, 2024
6256ad5
Add version extraction for nuget packages.
skrustev Oct 10, 2024
7fd74bd
Try to correctly specify dependency folder.
skrustev Oct 17, 2024
3d3e9ac
Switch back path to deps.
skrustev Oct 17, 2024
77b39bb
Use one level up.
skrustev Oct 17, 2024
fd7b9ab
Restore dep path.
skrustev Oct 17, 2024
8019a09
Try with single test worker.
skrustev Oct 21, 2024
9c65840
Fix tests not launching their own instance of the samples browser. Ad…
skrustev Oct 24, 2024
21e2686
Disable https redirect for tests.
skrustev Oct 24, 2024
7536432
Reduce number of workers.
skrustev Oct 24, 2024
3346310
Add test category
skrustev Oct 24, 2024
791424b
Add preflight test and categories.
skrustev Oct 24, 2024
f2f7c6e
Add playwright traces on failed tests.
skrustev Oct 24, 2024
6658dbf
Try add worker id
skrustev Oct 25, 2024
7b3212f
Try with machine name.
skrustev Oct 25, 2024
c690c80
Ignore divider and dialog.
skrustev Oct 25, 2024
3602f28
Merge branch 'vnext' into skrastev/playwright-tests
skrustev Oct 29, 2024
14b72ff
Update stepper event args.
skrustev Oct 30, 2024
e19efaf
Comment out questionable URL changes
turbobobbytraykov Nov 3, 2024
afc0dcf
Increase test workers.
skrustev Nov 11, 2024
f8a41ae
Double the number of test workers.
skrustev Nov 12, 2024
6e1db48
Decrease number of test workers.
skrustev Nov 12, 2024
bf7190f
Update settings and use TOC model from core. Add descriptions.
skrustev Nov 15, 2024
fb70a57
Revert "Comment out questionable URL changes"
skrustev Nov 20, 2024
463e6c5
Merge branch 'vnext' into skrastev/playwright-tests
skrustev Nov 21, 2024
4cf28c6
Expose host gulp tasts that run agent specific logic.
skrustev Nov 21, 2024
d55c680
Add generation of test selectors if none specified. Add Carousel test…
skrustev Nov 27, 2024
9b74735
Add missing step in readme regarding installing supported browsers f…
skrustev Nov 28, 2024
3fc728e
Add some resources for using Playwright.
skrustev Nov 29, 2024
31f9765
Add morei info related to generic tests and their configuration.
skrustev Nov 29, 2024
218aee6
chore: minor wording and typos
damyanpetev Dec 3, 2024
ae27839
chore: doc comment reformat
damyanpetev Dec 3, 2024
9da4e6e
chore: remove obsolete resources file
damyanpetev Dec 3, 2024
6e54b2d
docs: test settings models
damyanpetev Dec 3, 2024
a8307f9
chore: add readme to test server proj
damyanpetev Dec 3, 2024
174d45b
refactor: nullable behavior adjustments
damyanpetev Dec 3, 2024
71db261
refactor: case-insensitive deserialize
damyanpetev Dec 3, 2024
69a0acf
Finish up changed gulp task for local and agent run.
skrustev Dec 4, 2024
45d527b
Add settings for running tests not using in memory SB. Update readme.
skrustev Dec 4, 2024
da3171d
Rename copy samples task name.
skrustev Dec 4, 2024
6abfa2e
Revert unwanted changes committed.
skrustev Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

/browser/Tests

/browser/IgBlazorSamples.Test/Generated/**

# misc
.DS_Store
.env.local
Expand Down
7 changes: 7 additions & 0 deletions azure-pipelines/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local-packages" value="../Dependencies/Blazor_NuGet" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
4 changes: 2 additions & 2 deletions azure-pipelines/templates/build-steps-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ steps:
customCommand: ci

- task: CmdLine@2
displayName: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
displayName: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}CI'
inputs:
script: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}'
script: 'npx gulp copySamplesTo${{ parameters.projectToBuild }}CI'
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.Gulp'
failOnStderr: true

Expand Down
18 changes: 18 additions & 0 deletions browser/.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<NUnit>
<NumberOfTestWorkers>7</NumberOfTestWorkers>
</NUnit>
<Playwright>
<BrowserName>chromium</BrowserName>
<ExpectTimeout>5000</ExpectTimeout>
<LaunchOptions>
<!--<Headless>false</Headless>-->
</LaunchOptions>
</Playwright>
<TestRunParameters>
<Parameter name="defaultTimeout" value="40000" />
<Parameter name="useInMemoryClient" value="true" />
<Parameter name="testUrl" value="http://localhost:4200" />
</TestRunParameters>
</RunSettings>
18 changes: 18 additions & 0 deletions browser/IgBlazorSamples.Gulp/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,21 @@ exports.updateIG = updateIG = gulp.series(
sb.updateIG,
);

// Copy samples task used only for local run of the Samples Browser Server.
exports.copySamplesToServer = copySamplesToServer = gulp.series(
// sb.updateVersion,
sb.getSamples,
sb.copySamplesToServer,
);

// Copy samples task used on host agents. Samples Browser Server from there has added '/blazor-samples' to the base url.
exports.copySamplesToServerCI = copySamplesToServerCI = gulp.series(
// sb.updateVersion,
sb.getSamples,
sb.copySamplesToServerCI,
);

// Copy samples task used only for local run of the SB Client.
exports.copySamplesToClient = copySamplesToClient = gulp.series(
// sb.updateVersion,
sb.getSamples,
Expand All @@ -81,6 +90,15 @@ exports.copySamplesToClient = copySamplesToClient = gulp.series(
);
exports.updateBrowser = updateBrowser = copySamplesToClient;

// Copy samples task used on host agents. Samples Browser Client from there has added '/blazor-samples' to the base url.
exports.copySamplesToClientCI = copySamplesToClientCI = gulp.series(
// sb.updateVersion,
sb.getSamples,
sb.copySamplesToClientCI,
sb.updateCodeViewer,
sb.updateReadme,
);

exports.cleanupSampleBrowsers = cleanupSampleBrowsers = gulp.series(
sb.cleanupSampleBrowsers,
);
Expand Down
19 changes: 15 additions & 4 deletions browser/IgBlazorSamples.Gulp/tasks/gulp-samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ function copySamplePages(cb, outputPath) {
cb();
}

function copySampleScripts(cb, outputPath, indexName) {
function copySampleScripts(cb, outputPath, indexName, isLocalBuild) {
var insertScriptFiles = [];

log('deleting scripts in: ' + outputPath + '/wwwroot/sb/*.js');
Expand Down Expand Up @@ -464,7 +464,6 @@ function copySampleScripts(cb, outputPath, indexName) {

// indexLines = indexLines.filter((v, i, a) => a.indexOf(v) === i);

var isLocalBuild = __dirname.indexOf('Agent') < 0;
for (let i = 0; i < indexLines.length; i++) {
if (indexLines[i].indexOf('<base href') > 0) {
if (isLocalBuild) {
Expand Down Expand Up @@ -492,19 +491,31 @@ function copySampleScripts(cb, outputPath, indexName) {
// '../../browser/IgBlazorSamples.Server/wwwroot'
function copySamplesToServer(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Server");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml", true);
copySamplePages(cb, "../../browser/IgBlazorSamples.Server");
} exports.copySamplesToServer = copySamplesToServer;

function copySamplesToServerCI(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Server");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Server", "/Pages/_Host.cshtml", false);
copySamplePages(cb, "../../browser/IgBlazorSamples.Server");
} exports.copySamplesToServerCI = copySamplesToServerCI;

// '../../browser/IgBlazorSamples.Client/Pages'
// '../../browser/IgBlazorSamples.Client/Services'
// '../../browser/IgBlazorSamples.Client/wwwroot'
function copySamplesToClient(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Client");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html", true);
copySamplePages(cb, "../../browser/IgBlazorSamples.Client");
} exports.copySamplesToClient = copySamplesToClient;

function copySamplesToClientCI(cb) {
cleanupSampleBrowser( "../../browser/IgBlazorSamples.Client");
copySampleScripts(cb, "../../browser/IgBlazorSamples.Client", "/wwwroot/index.html", false);
copySamplePages(cb, "../../browser/IgBlazorSamples.Client");
} exports.copySamplesToClientCI = copySamplesToClientCI;

function updateReadme(cb) {

var changeFilesCount = 0;
Expand Down
54 changes: 54 additions & 0 deletions browser/IgBlazorSamples.Test.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IgBlazorSamples.Client", "IgBlazorSamples.Client\IgBlazorSamples.Client.csproj", "{8D8DE753-4CD1-4B21-9C9F-2E40AE5EED1B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IgBlazorSamples.Shared", "IgBlazorSamples.Shared\IgBlazorSamples.Shared.csproj", "{FBA48919-F510-4D99-A3F6-6743A9C304D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IgBlazorSamples.Core", "IgBlazorSamples.Core\IgBlazorSamples.Core.csproj", "{B64DD2DE-32F6-4CF8-B9F5-7F0E29796460}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F85EE908-E593-4D66-A46D-2193EF3C98C2}"
ProjectSection(SolutionItems) = preProject
.runsettings = .runsettings
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IgBlazorSamples.TestServer", "IgBlazorSamples.TestServer\IgBlazorSamples.TestServer.csproj", "{3E6A34E9-442D-4CC0-BE26-0C872B51FF55}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IgBlazorSamples.Test", "IgBlazorSamples.Test\IgBlazorSamples.Test.csproj", "{EFFA7E4D-7130-40AE-9E8B-6110FCB099AF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8D8DE753-4CD1-4B21-9C9F-2E40AE5EED1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D8DE753-4CD1-4B21-9C9F-2E40AE5EED1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D8DE753-4CD1-4B21-9C9F-2E40AE5EED1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D8DE753-4CD1-4B21-9C9F-2E40AE5EED1B}.Release|Any CPU.Build.0 = Release|Any CPU
{FBA48919-F510-4D99-A3F6-6743A9C304D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBA48919-F510-4D99-A3F6-6743A9C304D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBA48919-F510-4D99-A3F6-6743A9C304D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FBA48919-F510-4D99-A3F6-6743A9C304D2}.Release|Any CPU.Build.0 = Release|Any CPU
{B64DD2DE-32F6-4CF8-B9F5-7F0E29796460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B64DD2DE-32F6-4CF8-B9F5-7F0E29796460}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B64DD2DE-32F6-4CF8-B9F5-7F0E29796460}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B64DD2DE-32F6-4CF8-B9F5-7F0E29796460}.Release|Any CPU.Build.0 = Release|Any CPU
{3E6A34E9-442D-4CC0-BE26-0C872B51FF55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E6A34E9-442D-4CC0-BE26-0C872B51FF55}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E6A34E9-442D-4CC0-BE26-0C872B51FF55}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E6A34E9-442D-4CC0-BE26-0C872B51FF55}.Release|Any CPU.Build.0 = Release|Any CPU
{EFFA7E4D-7130-40AE-9E8B-6110FCB099AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EFFA7E4D-7130-40AE-9E8B-6110FCB099AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFFA7E4D-7130-40AE-9E8B-6110FCB099AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFFA7E4D-7130-40AE-9E8B-6110FCB099AF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2B229BA4-53C2-4C4E-8A25-BA19866A265A}
EndGlobalSection
EndGlobal
Loading
Loading