diff --git a/components/builder-web/.gitignore b/components/builder-web/.gitignore index 9a6b153090..8b6a44cbcf 100644 --- a/components/builder-web/.gitignore +++ b/components/builder-web/.gitignore @@ -5,8 +5,6 @@ assets/app.css.map assets/app.js assets/app.js.map assets/habitat.conf.js -cypress/screenshots -cypress/videos /habitat.conf.js node_modules npm-debug.log* diff --git a/components/builder-web/cypress.json b/components/builder-web/cypress.json deleted file mode 100644 index 7c248c8721..0000000000 --- a/components/builder-web/cypress.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "projectId": "48f7xo" -} diff --git a/components/builder-web/cypress/fixtures/package-detail/latest-linux.json b/components/builder-web/cypress/fixtures/package-detail/latest-linux.json deleted file mode 100644 index d4f8abbea1..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/latest-linux.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "build_deps": [], - "build_tdeps": [], - "channels": [ - "unstable", - "stable" - ], - "checksum": "c68daa563972effb33a068cdcf7cd56e8201c6edbf64ce3c78ae13296c697be1", - "config": "", - "created_at": "2019-08-13T19:31:55.349545", - "deps": [], - "exposes": [], - "id": "1312469229022773248", - "ident": { - "name": "cacerts", - "origin": "core", - "release": "20190115014206", - "version": "2018.12.05" - }, - "ident_array": [ - "core", - "cacerts", - "2018.12.05", - "20190115014206" - ], - "is_a_service": false, - "manifest": "# core / cacerts\nThe Mozilla CA certificate store in PEM format (around 250KB uncompressed).\n\n\n* __Maintainer__: The Habitat Maintainers \n* __Version__: 2018.12.05\n* __Release__: 20190115014206\n* __Target__: x86_64-linux\n* __Upstream URL__: [https://curl.haxx.se/docs/caextract.html](https://curl.haxx.se/docs/caextract.html)\n* __License__: MPL-2.0 \n* __Source__: [http://curl.haxx.se/ca/cacert.pem](http://curl.haxx.se/ca/cacert.pem)\n* __SHA__: SHA256 checksum not provided or required\n* __Path__: `/hab/pkgs/core/cacerts/2018.12.05/20190115014206`\n* __Build Dependencies__: no build dependencies or undefined\n* __Dependencies__: no runtime dependencies or undefined\n* __Interpreters__: no interpreters or undefined\n\n# Plan\n\n## Build Flags\n\n```bash\nCFLAGS: no CFLAGS\nCPPFLAGS: no CPPFLAGS\nCXXFLAGS: no CXXFLAGS\nLDFLAGS: no LDFLAGS\nLD_RUN_PATH: no LD_RUN_PATH\n```\n\n## Plan Source\n\n```bash\npkg_name=cacerts\npkg_origin=core\npkg_description=\"\\\nThe Mozilla CA certificate store in PEM format (around 250KB uncompressed).\n\"\npkg_upstream_url=\"https://curl.haxx.se/docs/caextract.html\"\npkg_license=('MPL-2.0')\npkg_maintainer=\"The Habitat Maintainers \"\npkg_source=\"http://curl.haxx.se/ca/cacert.pem\"\npkg_deps=()\npkg_build_deps=()\n\npkg_version() {\n local build_date\n # Extract the build date of the certificates file\n # shellcheck disable=SC2002\n build_date=\"$(cat \"$HAB_CACHE_SRC_PATH/$pkg_filename\" \\\n | grep 'Certificate data from Mozilla' \\\n | sed 's/^## Certificate data from Mozilla as of: //')\"\n\n # Update the `$pkg_version` value with the build date\n date --date=\"$build_date\" \"+%Y.%m.%d\"\n}\n\ndo_download() {\n do_default_download\n update_pkg_version\n}\n\n# Verify? This file? From the internet? Not just yet... ;)\ndo_verify() {\n build_line \"Not going to verify this until we have a stable solution\"\n return 0\n}\n\ndo_unpack() {\n mkdir -pv \"$HAB_CACHE_SRC_PATH/$pkg_dirname\"\n cp -v \"$HAB_CACHE_SRC_PATH/$pkg_filename\" \"$HAB_CACHE_SRC_PATH/$pkg_dirname\"\n}\n\ndo_build() {\n return 0\n}\n\ndo_install() {\n mkdir -pv \"$pkg_prefix/ssl/certs\"\n cp -v \"$pkg_filename\" \"$pkg_prefix/ssl/certs\"\n ln -sv certs/cacert.pem \"$pkg_prefix/ssl/cert.pem\"\n}\n```", - "name": "cacerts", - "origin": "core", - "owner_id": "1307498689308139520", - "target": "x86_64-linux", - "tdeps": [], - "updated_at": "2019-08-13T19:31:55.349545", - "visibility": "public" -} diff --git a/components/builder-web/cypress/fixtures/package-detail/project.json b/components/builder-web/cypress/fixtures/package-detail/project.json deleted file mode 100644 index 298cbf110a..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "1318646724968865392", - "origin": "core", - "owner_id": "1307498689208139520", - "package_name": "cacerts", - "name": "core/cacerts", - "plan_path": "cacerts/plan.sh", - "target": "x86_64-linux", - "visibility": "public", - "vcs_type": "git", - "vcs_data": "https://github.com/sauron/core-plans.git", - "vcs_installation_id": "1261365", - "auto_build": false, - "created_at": "2019-08-22T08:05:30.246592", - "updated_at": "2019-08-22T08:05:30.246592" -} diff --git a/components/builder-web/cypress/fixtures/package-detail/user-origins-empty.json b/components/builder-web/cypress/fixtures/package-detail/user-origins-empty.json deleted file mode 100644 index fe51488c70..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/user-origins-empty.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/components/builder-web/cypress/fixtures/package-detail/user-origins.json b/components/builder-web/cypress/fixtures/package-detail/user-origins.json deleted file mode 100644 index fb056b1720..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/user-origins.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "owner_id": "1307498689308139510", - "name": "core", - "created_at": "2019-08-13T19:11:42.741916", - "updated_at": "2019-08-13T19:11:42.741916", - "default_package_visibility": "public", - "package_count": 154 - } -] diff --git a/components/builder-web/cypress/fixtures/package-detail/version-releases.json b/components/builder-web/cypress/fixtures/package-detail/version-releases.json deleted file mode 100644 index b1d3017aea..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/version-releases.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "range_start": 0, - "range_end": 0, - "total_count": 1, - "data": [ - { - "origin": "core", - "name": "cacerts", - "version": "2018.06.20", - "release": "20180927173225", - "channels": [ - "unstable" - ], - "platforms": [ - "x86_64-linux-kernel2" - ] - } - ] -} diff --git a/components/builder-web/cypress/fixtures/package-detail/versions-all.json b/components/builder-web/cypress/fixtures/package-detail/versions-all.json deleted file mode 100644 index 42a77bdb81..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/versions-all.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "origin": "core", - "name": "cacerts", - "version": "2018.12.05", - "release_count": "1", - "latest": "20190115014206", - "platforms": [ - "x86_64-linux" - ], - "visibility": "public" - }, - { - "origin": "core", - "name": "cacerts", - "version": "2018.06.20", - "release_count": "1", - "latest": "20180927173225", - "platforms": [ - "x86_64-linux-kernel2" - ], - "visibility": "public" - }, - { - "origin": "core", - "name": "cacerts", - "version": "2017.01.17", - "release_count": "1", - "latest": "20170209064044", - "platforms": [ - "x86_64-windows" - ], - "visibility": "public" - }, - { - "origin": "core", - "name": "cacerts", - "version": "2017.03.27", - "release_count": "1", - "latest": "20170309064044", - "platforms": [ - "x86_64-darwin" - ], - "visibility": "public" - } -] diff --git a/components/builder-web/cypress/fixtures/package-detail/versions-empty.json b/components/builder-web/cypress/fixtures/package-detail/versions-empty.json deleted file mode 100644 index fe51488c70..0000000000 --- a/components/builder-web/cypress/fixtures/package-detail/versions-empty.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/components/builder-web/cypress/fixtures/search/none.json b/components/builder-web/cypress/fixtures/search/none.json deleted file mode 100644 index 60102bdbc0..0000000000 --- a/components/builder-web/cypress/fixtures/search/none.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "range_start": 0, - "range_end": 0, - "total_count": 0, - "data": [] -} diff --git a/components/builder-web/cypress/fixtures/search/page-1.json b/components/builder-web/cypress/fixtures/search/page-1.json deleted file mode 100644 index 8592bc2dfd..0000000000 --- a/components/builder-web/cypress/fixtures/search/page-1.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "range_start": 0, - "range_end": 49, - "total_count": 690, - "data": [ - { - "name": "7zip", - "origin": "core" - }, - { - "name": "LuaJIT", - "origin": "core" - }, - { - "name": "R", - "origin": "core" - }, - { - "name": "acbuild", - "origin": "core" - }, - { - "name": "acl", - "origin": "core" - }, - { - "name": "airlock", - "origin": "core" - }, - { - "name": "alex", - "origin": "core" - }, - { - "name": "alsa-lib", - "origin": "core" - }, - { - "name": "ansible", - "origin": "core" - }, - { - "name": "ant", - "origin": "core" - }, - { - "name": "apr", - "origin": "core" - }, - { - "name": "apr-util", - "origin": "core" - }, - { - "name": "artifactory", - "origin": "core" - }, - { - "name": "artifactory-pro", - "origin": "core" - }, - { - "name": "aspcud", - "origin": "core" - }, - { - "name": "aspnet-mvc1", - "origin": "core" - }, - { - "name": "aspnet-sample", - "origin": "core" - }, - { - "name": "at-spi2-atk", - "origin": "core" - }, - { - "name": "at-spi2-core", - "origin": "core" - }, - { - "name": "atk", - "origin": "core" - }, - { - "name": "attr", - "origin": "core" - }, - { - "name": "autoconf", - "origin": "core" - }, - { - "name": "autogen", - "origin": "core" - }, - { - "name": "automake", - "origin": "core" - }, - { - "name": "aws-cli", - "origin": "core" - }, - { - "name": "bash", - "origin": "core" - }, - { - "name": "bash-completion", - "origin": "core" - }, - { - "name": "bash-static", - "origin": "core" - }, - { - "name": "bats", - "origin": "core" - }, - { - "name": "bazel", - "origin": "core" - }, - { - "name": "bc", - "origin": "core" - }, - { - "name": "bdwgc", - "origin": "core" - }, - { - "name": "benchmark", - "origin": "core" - }, - { - "name": "bind", - "origin": "core" - }, - { - "name": "binutils", - "origin": "core" - }, - { - "name": "bison", - "origin": "core" - }, - { - "name": "bison2", - "origin": "core" - }, - { - "name": "boost", - "origin": "core" - }, - { - "name": "boost159", - "origin": "core" - }, - { - "name": "boringssl", - "origin": "core" - }, - { - "name": "builder-admin", - "origin": "core" - }, - { - "name": "builder-admin-proxy", - "origin": "core" - }, - { - "name": "builder-api", - "origin": "core" - }, - { - "name": "builder-api-proxy", - "origin": "core" - }, - { - "name": "builder-datastore", - "origin": "core" - }, - { - "name": "builder-graph", - "origin": "core" - }, - { - "name": "builder-jobsrv", - "origin": "core" - }, - { - "name": "builder-originsrv", - "origin": "core" - }, - { - "name": "builder-router", - "origin": "core" - }, - { - "name": "builder-scheduler", - "origin": "core" - } - ] -} diff --git a/components/builder-web/cypress/fixtures/search/page-2.json b/components/builder-web/cypress/fixtures/search/page-2.json deleted file mode 100644 index 57a8a59fcf..0000000000 --- a/components/builder-web/cypress/fixtures/search/page-2.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "range_start": 50, - "range_end": 99, - "total_count": 690, - "data": [ - { - "name": "builder-sessionsrv", - "origin": "core" - }, - { - "name": "builder-web", - "origin": "core" - }, - { - "name": "builder-worker", - "origin": "core" - }, - { - "name": "bundler", - "origin": "core" - }, - { - "name": "busybox", - "origin": "core" - }, - { - "name": "busybox-static", - "origin": "core" - }, - { - "name": "bzip2", - "origin": "core" - }, - { - "name": "bzip2-musl", - "origin": "core" - }, - { - "name": "c-ares", - "origin": "core" - }, - { - "name": "cabal-install", - "origin": "core" - }, - { - "name": "cacerts", - "origin": "core" - }, - { - "name": "caddy", - "origin": "core" - }, - { - "name": "cairo", - "origin": "core" - }, - { - "name": "camlp4", - "origin": "core" - }, - { - "name": "cargo-nightly", - "origin": "core" - }, - { - "name": "ccache", - "origin": "core" - }, - { - "name": "cerebro", - "origin": "core" - }, - { - "name": "certstrap", - "origin": "core" - }, - { - "name": "check", - "origin": "core" - }, - { - "name": "chef-dk", - "origin": "core" - }, - { - "name": "clang", - "origin": "core" - }, - { - "name": "clang-tools-extra", - "origin": "core" - }, - { - "name": "clens", - "origin": "core" - }, - { - "name": "clingo", - "origin": "core" - }, - { - "name": "cmake", - "origin": "core" - }, - { - "name": "cockroach", - "origin": "core" - }, - { - "name": "composer", - "origin": "core" - }, - { - "name": "compositeproto", - "origin": "core" - }, - { - "name": "concourse", - "origin": "core" - }, - { - "name": "concourse-fly", - "origin": "core" - }, - { - "name": "consul", - "origin": "core" - }, - { - "name": "coreutils", - "origin": "core" - }, - { - "name": "coreutils-static", - "origin": "core" - }, - { - "name": "cpanminus", - "origin": "core" - }, - { - "name": "cpio", - "origin": "core" - }, - { - "name": "cppcheck", - "origin": "core" - }, - { - "name": "cppunit", - "origin": "core" - }, - { - "name": "cpputest", - "origin": "core" - }, - { - "name": "crate", - "origin": "core" - }, - { - "name": "cuda", - "origin": "core" - }, - { - "name": "cuda-libs", - "origin": "core" - }, - { - "name": "curator", - "origin": "core" - }, - { - "name": "curator4", - "origin": "core" - }, - { - "name": "curl", - "origin": "core" - }, - { - "name": "curl-static-musl", - "origin": "core" - }, - { - "name": "cyrus-sasl", - "origin": "core" - }, - { - "name": "damageproto", - "origin": "core" - }, - { - "name": "db", - "origin": "core" - }, - { - "name": "dbus", - "origin": "core" - }, - { - "name": "dd-agent", - "origin": "core" - } - ] -} diff --git a/components/builder-web/cypress/fixtures/search/param.json b/components/builder-web/cypress/fixtures/search/param.json deleted file mode 100644 index d04ac56ec8..0000000000 --- a/components/builder-web/cypress/fixtures/search/param.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "range_start": 0, - "range_end": 1, - "total_count": 1, - "data": [ - { - "origin": "core", - "name": "acbuild" - }, - { - "origin": "core", - "name": "acl" - } - ] -} diff --git a/components/builder-web/cypress/fixtures/search/some.json b/components/builder-web/cypress/fixtures/search/some.json deleted file mode 100644 index fc10a4ca4f..0000000000 --- a/components/builder-web/cypress/fixtures/search/some.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "range_start": 0, - "range_end": 1, - "total_count": 2, - "data": [ - { - "name": "gawk", - "origin": "core" - }, - { - "name": "cacerts", - "origin": "core" - } - ] -} diff --git a/components/builder-web/cypress/integration/home.spec.ts b/components/builder-web/cypress/integration/home.spec.ts deleted file mode 100644 index 9c929bb6eb..0000000000 --- a/components/builder-web/cypress/integration/home.spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -describe('The default route', () => { - - beforeEach(() => { - cy.server(); - cy.fixture('search/some').as('some'); - cy.route('GET', '/v1/depot/pkgs/core?range=0&distinct=true', '@some'); - cy.visit('/#/'); - }); - - it('renders the search view', () => { - cy.get('header h1').should('contain', 'Search Packages'); - cy.get('.results-component li').children().should('have.length.greaterThan', 0); - }); -}); diff --git a/components/builder-web/cypress/integration/package-detail.spec.ts b/components/builder-web/cypress/integration/package-detail.spec.ts deleted file mode 100644 index d2cd1a8661..0000000000 --- a/components/builder-web/cypress/integration/package-detail.spec.ts +++ /dev/null @@ -1,187 +0,0 @@ -describe('Package Detail', () => { - - const breadcrumbNav = () => cy.get('hab-package-breadcrumbs'); - - const breadcrumbNavLinks = () => breadcrumbNav().find('a'); - - const tabNav = () => cy.get('nav.tabs'); - - const tabNavLinks = () => tabNav().find('a'); - - const pkgManifest = () => cy.get('.package-manifest'); - - const pkgVersions = () => cy.get('.package-versions-component'); - - const pkgBuildHelp = () => cy.get('.package-latest-component .none'); - - const platformNav = () => cy.get('nav.platform-options'); - - const platformNavLinks = () => platformNav().find('a'); - - const buildBtn = () => cy.get('button.build'); - - beforeEach(() => { - cy.server(); - - cy.fixture('package-detail/user-origins').as('userOrigins'); - cy.fixture('package-detail/user-origins-empty').as('userOriginsEmpty'); - cy.fixture('package-detail/latest-linux').as('pkgLatestLinux'); - cy.fixture('package-detail/project').as('pkgProject'); - cy.fixture('package-detail/versions-all').as('pkgVersionsAll'); - cy.fixture('package-detail/versions-empty').as('pkgVersionsEmpty'); - cy.fixture('package-detail/version-releases').as('pkgVersionReleases'); - - cy.route('GET', '/v1/user/origins', '@userOriginsEmpty'); - cy.route('GET', '/v1/depot/pkgs/core/cacerts/latest?target=x86_64-linux', '@pkgLatestLinux'); - cy.route('GET', '/v1/projects/core/cacerts?target=x86_64-linux', '@pkgProject'); - cy.route('GET', '/v1/depot/pkgs/core/cacerts/versions', '@pkgVersionsAll'); - cy.route('GET', '/v1/depot/pkgs/core/cacerts/2018.06.20?range=0', '@pkgVersionReleases'); - - cy.setSession(); - }); - - it('displays breadcrumb links', () => { - cy.visit('/#/pkgs/core/cacerts'); - - breadcrumbNav().should('be.visible'); - breadcrumbNavLinks().should('have.length', 2); - breadcrumbNavLinks().eq(0).should('contain', 'core'); - breadcrumbNavLinks().eq(1).should('contain', 'cacerts'); - }); - - it('displays tab links', () => { - cy.visit('/#/pkgs/core/cacerts'); - - tabNav().should('be.visible'); - tabNavLinks().should('not.have.length', 0); - }); - - describe('when viewing as member of the pkg origin', () => { - - beforeEach(() => { - cy.route('GET', '/v1/user/origins', '@userOrigins'); - }); - - it('displays all tab links', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - tabNav().should('be.visible'); - tabNavLinks().should('have.length', 4); - tabNavLinks().eq(0).should('contain', 'Latest'); - tabNavLinks().eq(1).should('contain', 'Versions'); - tabNavLinks().eq(2).should('contain', 'Build Jobs'); - tabNavLinks().eq(3).should('contain', 'Settings'); - }); - - it('displays a "Build latest" button', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - buildBtn().should('be.visible'); - buildBtn().should('contain', 'Build latest version'); - }); - }); - - describe('when viewing as non-member of the pkg origin', () => { - beforeEach(() => { - cy.route('GET', '/v1/user/origins', '@userOriginsEmpty'); - }); - - it('displays only "Latest" and "Versions" tab links', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - tabNav().should('be.visible'); - tabNavLinks().should('have.length', 2); - tabNavLinks().eq(0).should('contain', 'Latest'); - tabNavLinks().eq(1).should('contain', 'Versions'); - }); - }); - - describe('tab content for "Latest"', () => { - - it('displays the package manifest', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - pkgManifest().should('be.visible'); - pkgManifest().should('contain', 'Maintainer'); - pkgManifest().should('contain', 'Version'); - pkgManifest().should('contain', 'Release'); - pkgManifest().should('contain', 'Target'); - }); - - describe('when multiple platforms are supported', () => { - - it('displays a platform selector', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - platformNav().should('be.visible'); - platformNavLinks().should('have.length', 4); - platformNavLinks().eq(0).should('contain', 'Linux'); - platformNavLinks().eq(1).should('contain', 'Linux 2'); - platformNavLinks().eq(2).should('contain', 'Windows'); - platformNavLinks().eq(3).should('contain', 'macOS'); - }); - }); - - describe('when viewing a newly-created project', () => { - beforeEach(() => { - cy.route('GET', '/v1/depot/pkgs/core/cacerts/versions', '@pkgVersionsEmpty'); - cy.route({ route: 'GET', url: '/v1/depot/pkgs/core/cacerts/latest?target=x86_64-linux', status: 404 }); - }); - - it('does not display a platform selector', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - platformNav().should('not.be.visible'); - }); - - it('does not display a package manifest', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - pkgManifest().should('not.be.visible'); - }); - - it('displays help text for creating artifacts', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - pkgBuildHelp().should('be.visible'); - pkgBuildHelp().should('contain', 'There are two ways to add .hart files'); - }); - - describe('and when viewing as member of the pkg origin', () => { - beforeEach(() => { - cy.route('GET', '/v1/user/origins', '@userOrigins'); - }); - - it('displays build button as "Build latest versions"', () => { - cy.visit('/#/pkgs/core/cacerts/latest'); - - buildBtn().should('be.visible'); - buildBtn().should('contain', 'Build latest versions'); - }); - }); - }); - }); - - describe('tab content for "Versions"', () => { - - it('displays a list of versions', () => { - cy.visit('/#/pkgs/core/cacerts/versions'); - - pkgVersions().should('be.visible'); - pkgVersions().should('contain', 'Version'); - pkgVersions().should('contain', 'Releases'); - pkgVersions().should('contain', 'Updated'); - pkgVersions().should('contain', 'Platforms'); - }); - - describe('when URL contains a specific version', () => { - - it('displays versions list with that specific version toggled open', () => { - cy.visit('/#/pkgs/core/cacerts/2018.06.20'); - - const versionRow = pkgVersions().get('.toggle-list > div:nth-child(3)'); - versionRow.get('.nav-list').should('be.visible'); - }); - }); - }); -}); diff --git a/components/builder-web/cypress/integration/search.spec.ts b/components/builder-web/cypress/integration/search.spec.ts deleted file mode 100644 index f823b509b8..0000000000 --- a/components/builder-web/cypress/integration/search.spec.ts +++ /dev/null @@ -1,81 +0,0 @@ -describe('Search', () => { - - const results = () => cy.get('.results-component li'); - const summary = () => cy.get('.more'); - const moreLink = () => cy.get('.more a'); - const none = () => cy.get('.results-component .none'); - - beforeEach(() => { - cy.server(); - - cy.fixture(`search/page-1`).as('page1'); - cy.fixture(`search/page-2`).as('page2'); - cy.fixture(`search/param`).as('search'); - cy.fixture('search/none').as('none'); - - cy.route('GET', `/v1/depot/pkgs/core?range=0&distinct=true`, '@page1'); - cy.route('GET', `/v1/depot/pkgs/core?range=50&distinct=true`, '@page2'); - cy.route('GET', `/v1/depot/pkgs/search/ac?range=0&distinct=true`, '@search'); - cy.route('GET', `/v1/depot/pkgs/search/nope?range=0&distinct=true`, '@none'); - }); - - describe('given an origin in the URL path', () => { - - beforeEach(() => { - cy.visit('/#/pkgs/core'); - }); - - it('renders the first page of results from the that origin', () => { - results().should('have.length', 50); - }); - }); - - describe('given a querystring param', () => { - - beforeEach(() => { - cy.visit('/#/pkgs/core;q=ac'); - }); - - it('renders results based on that param', () => { - results().should('have.length', 2); - }); - }); - - describe('when more than one page of results exists', () => { - - beforeEach(() => { - cy.visit('/#/pkgs/core'); - }); - - it('renders the first page', () => { - results().should('have.length', 50); - summary().should('contain', 'Showing 50 of 690 packages.'); - moreLink().should('contain', 'Load 50 more.'); - }); - - describe('and I click to load more', () => { - - beforeEach(() => { - cy.get('.more a').click(); - }); - - it('renders the second page', () => { - results().should('have.length', 100); - summary().should('contain', 'Showing 100 of 690 packages.'); - moreLink().should('contain', 'Load 50 more.'); - }); - }); - }); - - describe('when no results are found', () => { - - beforeEach(() => { - cy.visit('/#/pkgs/core;q=nope'); - }); - - it('shows a not-found message', () => { - results().should('have.length', 0); - none().should('contain', 'No packages found.'); - }); - }); -}); diff --git a/components/builder-web/cypress/plugins/index.js b/components/builder-web/cypress/plugins/index.js deleted file mode 100644 index dffed2532f..0000000000 --- a/components/builder-web/cypress/plugins/index.js +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// This function is called when a project is opened or re-opened (e.g. due to -// the project's config changing) - -module.exports = (on, config) => { - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -}; diff --git a/components/builder-web/cypress/support/commands.js b/components/builder-web/cypress/support/commands.js deleted file mode 100644 index ae87ea2e8a..0000000000 --- a/components/builder-web/cypress/support/commands.js +++ /dev/null @@ -1,11 +0,0 @@ -Cypress.Commands.add('setSession', () => { - cy.setCookie('bldrSessionToken', 'CIDAgMSW5MqSEhIGNDc6MTIxGAAiKGRkNGQzNzcwYWM0ZDg5MzNhNjU2NzBkOTQ4MmM1YmMxYTA0Y2ExY2E='); - cy.setCookie('oauthToken', 'dd4d3770ac4d8933a65670d9482c5ec1a04ca1ca'); - cy.setCookie('oauthState', '612fc2d4-2a28-42be-a3f2-22bd8b5cb1a2'); -}); - -Cypress.Commands.add('clearSession', () => { - cy.clearCookie('bldrSessionToken'); - cy.clearCookie('oauthToken'); - cy.clearCookie('oauthState'); -}); diff --git a/components/builder-web/cypress/support/index.js b/components/builder-web/cypress/support/index.js deleted file mode 100644 index c6a9caaeb2..0000000000 --- a/components/builder-web/cypress/support/index.js +++ /dev/null @@ -1,21 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands' - -Cypress.on('window:before:load', win => { - win.fetch = null; -}); diff --git a/components/builder-web/cypress/tsconfig.json b/components/builder-web/cypress/tsconfig.json deleted file mode 100644 index 606f409434..0000000000 --- a/components/builder-web/cypress/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "types": [ - "cypress" - ] - }, - "include": [ - "**/*" - ] -} diff --git a/components/builder-web/package-lock.json b/components/builder-web/package-lock.json index 6cd81bfc13..a43599a23d 100644 --- a/components/builder-web/package-lock.json +++ b/components/builder-web/package-lock.json @@ -419,72 +419,6 @@ "to-fast-properties": "^2.0.0" } }, - "@cypress/listr-verbose-renderer": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@cypress/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz", - "integrity": "sha1-p3SS9LEdzHxEajSz4ochr9M8ZCo=", - "dev": true, - "requires": { - "chalk": "^1.1.3", - "cli-cursor": "^1.0.2", - "date-fns": "^1.27.2", - "figures": "^1.7.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, - "@cypress/xvfb": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", - "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", - "dev": true, - "requires": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - } - } - }, "@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -2479,97 +2413,6 @@ "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, - "cypress": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-3.8.3.tgz", - "integrity": "sha512-I9L/d+ilTPPA4vq3NC1OPKmw7jJIpMKNdyfR8t1EXYzYCjyqbc59migOm1YSse/VRbISLJ+QGb5k4Y3bz2lkYw==", - "dev": true, - "requires": { - "@cypress/listr-verbose-renderer": "0.4.1", - "@cypress/xvfb": "1.2.4", - "@types/sizzle": "2.3.2", - "arch": "2.1.1", - "bluebird": "3.5.0", - "cachedir": "1.3.0", - "chalk": "2.4.2", - "check-more-types": "2.24.0", - "commander": "2.15.1", - "common-tags": "1.8.0", - "debug": "3.2.6", - "eventemitter2": "4.1.2", - "execa": "0.10.0", - "executable": "4.1.1", - "extract-zip": "1.6.7", - "fs-extra": "5.0.0", - "getos": "3.1.1", - "is-ci": "1.2.1", - "is-installed-globally": "0.1.0", - "lazy-ass": "1.6.0", - "listr": "0.12.0", - "lodash": "4.17.15", - "log-symbols": "2.2.0", - "minimist": "1.2.0", - "moment": "2.24.0", - "ramda": "0.24.1", - "request": "2.88.0", - "request-progress": "3.0.0", - "supports-color": "5.5.0", - "tmp": "0.1.0", - "untildify": "3.0.3", - "url": "0.11.0", - "yauzl": "2.10.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "lodash": { - "version": "4.17.15", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", - "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", - "dev": true - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "moment": { - "version": "2.24.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", - "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "tmp": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.1.0.tgz", - "integrity": "sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==", - "dev": true, - "requires": { - "rimraf": "^2.6.3" - } - } - } - }, "d": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", diff --git a/components/builder-web/package.json b/components/builder-web/package.json index 1e3a223e6e..e93b3bccb8 100644 --- a/components/builder-web/package.json +++ b/components/builder-web/package.json @@ -31,9 +31,6 @@ "serve-e2e": "lite-server -c ./bs-config.e2e.js", "start": "bin/start", "test": "npm run test-unit && npm run test-e2e", - "test-e2e": "npm run build-e2e && concurrently --success first --kill-others 'npm run serve-e2e' 'cypress run'", - "test-e2e-record": "npm run build-e2e && concurrently --success first --kill-others 'npm run serve-e2e' 'cypress run --record'", - "test-e2e-watch": "concurrently 'npm start' 'cypress open'", "test-unit": "karma start", "test-unit-watch": "npm run test-unit -- --no-single-run", "test-watch": "concurrently 'npm run test-unit-watch' 'npm run test-e2e-watch'", @@ -76,7 +73,6 @@ "awesome-typescript-loader": "^5.2.1", "codelyzer": "^4.4.4", "concurrently": "^3.6.1", - "cypress": "^3.4.1", "http-proxy-middleware": "^0.19.2", "jasmine-core": "^3.7.1", "karma": "^6.3.2",