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

#2911 cypress e2e #3451

Merged
merged 72 commits into from
Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
aba54dc
cypress_init_0.1
petersopko Jul 15, 2022
414ba10
cypress_init_0.1.1
petersopko Jul 16, 2022
6918218
cypress_init_0.1.2
petersopko Jul 16, 2022
e493933
testing_netlify+cypress
petersopko Jul 16, 2022
e235304
testing_netlify+cypress_0.2
petersopko Jul 16, 2022
0bd3631
cypress_dev_dependency
petersopko Jul 16, 2022
d0b1a8b
manually_changed_package_json_im_sorry
petersopko Jul 16, 2022
877d760
removing_cypress_cache
petersopko Jul 16, 2022
448a5fd
removing_prebuild_plugin
petersopko Jul 16, 2022
561545a
reset+revert_netlify_experiment
petersopko Jul 16, 2022
c51510e
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Jul 16, 2022
eec374c
testing_gh_action
petersopko Jul 17, 2022
33afece
testing_gh_action_2
petersopko Jul 17, 2022
b2c2a37
added_more_bsx_tests
petersopko Jul 18, 2022
62216f8
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Jul 18, 2022
1f8e3e3
remove_gh_action
petersopko Jul 18, 2022
5c56b25
Merge remote-tracking branch 'upstream/main' into 2911-cypress-init
petersopko Jul 18, 2022
64e7a45
add_random_wallet_login
petersopko Jul 18, 2022
7f1c9c0
add_random_wallet_login
petersopko Jul 18, 2022
5ce02aa
Merge branch 'main' into 2911-cypress-init
petersopko Jul 21, 2022
c6b9e9a
custom_commands
petersopko Jul 21, 2022
0296856
Merge branch 'main' into 2911-cypress-init
petersopko Jul 25, 2022
c829675
clean_up
petersopko Jul 25, 2022
5157901
exploreTabs+exploreSortBy
petersopko Jul 25, 2022
842877e
collectionSortBy+gallerySortBy
petersopko Jul 25, 2022
0882e12
navbar+stuff
petersopko Jul 25, 2022
644a2ef
global_viewPort
petersopko Jul 25, 2022
c12629f
handle_exceptions_globally
petersopko Jul 25, 2022
6bd93bd
remove_cookies_removal
petersopko Jul 25, 2022
a80846e
sort_cleanup
petersopko Jul 25, 2022
a69151c
expandGallerySearch
petersopko Jul 26, 2022
57293d0
buyNow_checks_tweaking
petersopko Jul 26, 2022
9581f90
price_check_sort+inputField+buyNow
petersopko Jul 26, 2022
2313907
Merge branch 'main' into 2911-cypress-init
petersopko Jul 26, 2022
8ada06a
Merge branch 'main' into 2911-cypress-init
petersopko Jul 26, 2022
802c9aa
deepsource+eslint
petersopko Jul 26, 2022
6fda202
add_consola
petersopko Jul 26, 2022
ecb9822
reorganizing_file_structure
petersopko Jul 27, 2022
d9c54f5
Merge branch 'main' into 2911-cypress-init
petersopko Jul 27, 2022
460cf1a
added_logged_in_actions
petersopko Jul 27, 2022
e6ef343
added_rmrk_item_details+cleanup
petersopko Jul 28, 2022
4868b0f
remove_unused_creator
petersopko Jul 28, 2022
cd5a785
pnpm_clean_install
petersopko Jul 28, 2022
c5b44cc
Merge branch 'main' into 2911-cypress-init
petersopko Jul 28, 2022
4d60299
landingRmrk+landingBsx_reformat_data-cy
petersopko Jul 28, 2022
315cbfd
collectionSortBy+buyNow+gallerySortBy_refactor_data-cy
petersopko Jul 29, 2022
fd20af2
expandGallery+exploreTabsFix_refactor_data-cy
petersopko Jul 29, 2022
267d467
inputMinChange
petersopko Jul 30, 2022
9f4b454
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Aug 1, 2022
49e961d
temp_fix_smoldot
petersopko Aug 1, 2022
96c5d4f
Merge branch 'main' into 2911-cypress-init
petersopko Aug 1, 2022
a4cdcf4
finished_selectors
petersopko Aug 2, 2022
2449cbc
Merge remote-tracking branch 'upstream/main' into 2911-cypress-init
petersopko Aug 2, 2022
2df6e35
removing_cy-wait+additions
petersopko Aug 2, 2022
8d8368d
Merge branch 'main' into 2911-cypress-init
petersopko Aug 3, 2022
f2e4b3a
last_changes_data-cy
petersopko Aug 3, 2022
74e8e4b
fix_eslint
petersopko Aug 3, 2022
ad9b389
details
petersopko Aug 3, 2022
9c00ab4
Merge branch 'main' into 2911-cypress-init
kkukelka Aug 4, 2022
de3aa01
Merge remote-tracking branch 'upstream/main' into 2911-cypress-init
petersopko Aug 4, 2022
3aeef81
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Aug 4, 2022
55afa11
remove_dev-win
petersopko Aug 4, 2022
3c72027
Merge branch 'main' into 2911-cypress-init
petersopko Aug 4, 2022
d1b2ff9
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Aug 4, 2022
c12d1b4
Merge branch 'main' into 2911-cypress-init
petersopko Aug 4, 2022
02b83c6
added_desc_to_tests
petersopko Aug 4, 2022
94d1998
Merge branch 'main' into 2911-cypress-init
petersopko Aug 4, 2022
9c59a0d
last_details
petersopko Aug 4, 2022
e971997
:wrench: package json command for cypress
vikiival Aug 5, 2022
2c01cfb
last_details2
petersopko Aug 5, 2022
ce92a45
Merge branch 'main' into 2911-cypress-init
petersopko Aug 5, 2022
2d5168c
Merge remote-tracking branch 'origin/2911-cypress-init' into 2911-cyp…
petersopko Aug 5, 2022
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
62 changes: 49 additions & 13 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@
arrowless
collapsible
id="NavCreate"
v-show="isCreateVisible">
v-show="isCreateVisible"
data-cy="create-dropdown">
<template #label>
<span>{{ $t('create') }}</span>
</template>
<b-tooltip
label="Start by creating your collection and add NFTs to it"
position="is-right">
<b-navbar-item tag="nuxt-link" :to="`/${urlPrefix}/create`">
<b-navbar-item
tag="nuxt-link"
:to="`/${urlPrefix}/create`"
data-cy="classic">
{{ $t('classic') }}
</b-navbar-item>
</b-tooltip>
Expand All @@ -76,44 +80,76 @@
label="Simplified process to create your NFT in a single step"
position="is-right"
style="display: block">
<b-navbar-item tag="nuxt-link" :to="`/${urlPrefix}/mint`">
<b-navbar-item
tag="nuxt-link"
:to="`/${urlPrefix}/mint`"
data-cy="simple">
{{ $t('simple') }}
</b-navbar-item>
</b-tooltip>
<b-tooltip
label="AI powered process to create your NFT"
position="is-right"
append-to-body>
<b-navbar-item tag="nuxt-link" :to="`/${urlPrefix}/creative`">
<b-navbar-item
tag="nuxt-link"
:to="`/${urlPrefix}/creative`"
data-cy="creative">
{{ $t('creative') }}
</b-navbar-item>
</b-tooltip>
</template>
</b-navbar-dropdown>
<b-navbar-item tag="nuxt-link" :to="`/${urlPrefix}/explore`">
<b-navbar-item
tag="nuxt-link"
:to="`/${urlPrefix}/explore`"
data-cy="explore">
<span>{{ $t('explore') }}</span>
</b-navbar-item>
<b-navbar-item v-if="isBsx" tag="nuxt-link" :to="`/${urlPrefix}/stats`">
<b-navbar-item
v-if="isBsx"
tag="nuxt-link"
:to="`/${urlPrefix}/stats`"
data-cy="stats">
<span>{{ $t('stats') }}</span>
</b-navbar-item>
<b-navbar-dropdown arrowless collapsible v-if="isRmrk" id="NavStats">
<b-navbar-dropdown
arrowless
collapsible
v-if="isRmrk"
id="NavStats"
data-cy="stats">
<template #label>
<span>{{ $t('stats') }}</span>
</template>
<template>
<b-navbar-item tag="nuxt-link" to="/spotlight">
<b-navbar-item tag="nuxt-link" to="/spotlight" data-cy="spotlight">
{{ $t('spotlight.page') }}
</b-navbar-item>
<b-navbar-item tag="nuxt-link" to="/series-insight">
<b-navbar-item
tag="nuxt-link"
to="/series-insight"
data-cy="series-insight">
Series
</b-navbar-item>
<b-navbar-item tag="nuxt-link" to="/sales"> Sales </b-navbar-item>
<b-navbar-item tag="nuxt-link" to="/hot"> Hot </b-navbar-item>
<b-navbar-item tag="nuxt-link" to="/sales" data-cy="sales">
Sales
</b-navbar-item>
<b-navbar-item tag="nuxt-link" to="/hot" data-cy="hot">
Hot
</b-navbar-item>
</template>
</b-navbar-dropdown>
<LazyChainSelect class="custom-navbar-item" id="NavChainSelect" />
<LazySwitchLocale class="custom-navbar-item" id="NavLocaleChanger" />
<NavbarProfileDropdown :isRmrk="isRmrk" :isBsx="isBsx" id="NavProfile" />
<LazySwitchLocale
class="custom-navbar-item"
id="NavLocaleChanger"
data-cy="localChanger" />
<NavbarProfileDropdown
:isRmrk="isRmrk"
:isBsx="isBsx"
id="NavProfile"
data-cy="profileDropdown" />
</template>
<template #end v-else>
<div class="image is-32x32 mr-2">
Expand Down
3 changes: 2 additions & 1 deletion components/bsx/Gallery/Item/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
outlined
expanded
class="only-border-top"
@click="handleActionSelect(action)">
@click="handleActionSelect(action)"
:data-cy="action">
{{ actionLabel(action) }}
</b-button>
</b-tooltip>
Expand Down
7 changes: 4 additions & 3 deletions components/bsx/Gallery/Item/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</div>
<div class="price-block__container">
<div class="price-block__original">
<Money :value="nft.price" inline />
<Money :value="nft.price" inline data-cy="money" />
</div>
<b-button
v-if="nft.currentOwner === accountId"
Expand Down Expand Up @@ -137,8 +137,9 @@
:current-owner-id="nft.currentOwner"
:nftId="id"
@offersUpdate="offersUpdate"
:collectionId="collectionId" />
<History :events="events" :openOnDefault="false" />
:collectionId="collectionId"
data-cy="offer-list" />
<History :events="events" :openOnDefault="false" data-cy="history" />
</template>
</BaseGalleryItem>
</template>
Expand Down
3 changes: 2 additions & 1 deletion components/rmrk/Collection/List/CollectionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<nuxt-link
:to="`/${urlPrefix}/collection/${collection.id}`"
tag="div"
class="card collection-card">
class="card collection-card"
:data-cy="results.indexOf(collection)">
<div class="card-image">
<BasicImage
:src="collection.image"
Expand Down
2 changes: 1 addition & 1 deletion components/rmrk/ExploreLayout/ExploreLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{ $t('general.searchResultsText') }}
<span class="text__stroked is-size-3">{{ $route.query.search }}</span>
</div>
<b-tabs v-model="selectedTab">
<b-tabs v-model="selectedTab" data-cy="tabs">
<b-tab-item label="Collections" value="COLLECTION">
<template v-if="selectedTab === 'COLLECTION'">
<CollectionList />
Expand Down
3 changes: 2 additions & 1 deletion components/rmrk/Gallery/AvailableActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
style="border-width: 2px"
outlined
@click="handleAction(ShoppingActions.BUY)"
expanded>
expanded
data-cy="BUY">
{{ replaceBuyNowWithYolo ? 'YOLO' : actionLabel('BUY') }}
</b-button>
</b-tooltip>
Expand Down
6 changes: 5 additions & 1 deletion components/rmrk/Gallery/CollectionDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
<div class="level-item column is-6 has-text-centered">
<div>
<p class="heading--inline heading">
{{ $t('Floor') }} : <Money :value="collectionFloorPrice" inline />
{{ $t('Floor') }} :
<Money
:value="collectionFloorPrice"
inline
data-cy="collection-floor-price" />
</p>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions components/rmrk/Gallery/CollectionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
v-if="sharingVisible"
class="mb-2"
:label="name"
:iframe="iframeSettings">
:iframe="iframeSettings"
data-cy="share-button">
<DestroyCollection v-if="isOwner && urlPrefix === 'bsx'" :id="id" />
<DonationButton :address="issuer" />
<DonationButton :address="issuer" data-cy="donation-button" />
</Sharing>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion components/rmrk/Gallery/Gallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
<span
v-if="nft.price > 0 && showPriceValue"
class="card-image__price">
<Money :value="nft.price" inline />
<Money
:value="nft.price"
inline
:data-cy="results.indexOf(nft)" />
</span>
</div>

Expand Down
3 changes: 2 additions & 1 deletion components/rmrk/Gallery/GalleryCardList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
:price="nft.price"
:emoteCount="nft.emoteCount"
:currentOwner="nft.currentOwner"
:listed="listed" />
:listed="listed"
:data-cy="items.indexOf(nft)" />
</div>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions components/rmrk/Gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</div>
<div class="price-block__container">
<div class="price-block__original">
<Money :value="nft.price" inline />
<Money :value="nft.price" inline data-cy="money" />
</div>
<b-button
v-if="nft.currentOwner === accountId"
Expand Down Expand Up @@ -129,7 +129,8 @@
v-if="!isLoading"
:events="nft.events"
:open-on-default="!compactGalleryItem"
@setPriceChartData="setPriceChartData" />
@setPriceChartData="setPriceChartData"
data-cy="history" />
</div>
</div>
</template>
Expand Down
5 changes: 4 additions & 1 deletion components/rmrk/Gallery/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
</template>
<div class="box">
<div class="is-flex is-justify-content-space-between box-container">
<b-select placeholder="Select an event" v-model="selectedEvent">
<b-select
placeholder="Select an event"
v-model="selectedEvent"
data-cy="select-event">
<option
v-for="option in uniqType"
:value="option.type"
Expand Down
12 changes: 8 additions & 4 deletions components/rmrk/Gallery/Search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
aria-controls="sortAndFilter"
type="is-primary is-bordered-light"
class="is-hidden-mobile mr-2"
@click="isVisible = !isVisible" />
@click="isVisible = !isVisible"
data-cy="expand-search" />
<slot name="next-filter"></slot>
<b-autocomplete
v-if="!hideSearchInput"
Expand Down Expand Up @@ -134,21 +135,24 @@
step="any"
class="column is-2"
:placeholder="$t('query.priceRange.minPrice')"
v-model="rangeSlider[0]">
v-model="rangeSlider[0]"
data-cy="input-min">
</b-input>
<b-input
min="0"
step="any"
type="number"
class="column is-2"
:placeholder="$t('query.priceRange.maxPrice')"
v-model="rangeSlider[1]">
v-model="rangeSlider[1]"
data-cy="input-max">
</b-input>
<div class="column is-1">
<b-button
class="is-primary"
@click="sliderChange(rangeSlider)"
:disabled="applyDisabled">
:disabled="applyDisabled"
data-cy="apply">
{{ $t('general.apply') }}
</b-button>
</div>
Expand Down
16 changes: 13 additions & 3 deletions components/rmrk/Gallery/Search/SearchSortDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,27 @@
v-model="selectedAction"
class="select-dropdown">
<template #trigger>
<b-button type="is-primary" icon-right="caret-down"> Sort by </b-button>
<b-button
type="is-primary"
icon-right="caret-down"
data-cy="gallery-sort-by">
Sort by
</b-button>
</template>
<b-dropdown-item v-for="action in actions" :key="action" :value="action">
<b-dropdown-item
v-for="action in actions"
:key="action"
:value="action"
:data-cy="$t('sort.' + action)">
{{ $t('sort.' + action) }}
</b-dropdown-item>
</b-dropdown>
<b-select
v-else
v-model="selectedAction"
placeholder="Sort by"
class="select-dropdown">
class="select-dropdown"
data-cy="collection-sort-by">
<option v-for="action in actions" :key="action" :value="action">
{{
isCollection ? $t('sort.collection.' + action) : $t('sort.' + action)
Expand Down
3 changes: 2 additions & 1 deletion components/shared/IdentityPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
interactive
:animate-fill="false"
placement="bottom"
:delay="[100, 800]">
:delay="[100, 800]"
data-cy="identity">
<template v-slot:trigger>
<slot name="trigger" />
</template>
Expand Down
3 changes: 2 additions & 1 deletion components/shared/form/BasicSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
:rounded="false"
:size="size"
:disabled="disabled"
:class="labelColor">
:class="labelColor"
data-cy="buy-now">
<component :is="componentName" :label="message">
{{ properLabel }}
</component>
Expand Down
1 change: 0 additions & 1 deletion cypress.json

This file was deleted.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"lint:quiet": "eslint --quiet --ignore-path .gitignore --ext .js,.ts,.vue .",
"lint:fix": "eslint --fix --quiet --ignore-path .gitignore --ext .js,.ts,.vue .",
"test": "vitest run --reporter verbose --allowOnly",
"test:e2e": "cypress run --project tests",
"test:watch": "vitest --reporter verbose --allowOnly",
"prepare": "husky install"
},
Expand Down Expand Up @@ -79,6 +80,7 @@
"chartjs-plugin-annotation": "^1.4.0",
"chartjs-plugin-zoom": "^1.2.1",
"css-loader": "5.2.7",
"cypress": "^10.3.0",
"date-fns": "^2.29.1",
"emoji-unicode": "^2.0.1",
"graphql": "^16.5.0",
Expand Down Expand Up @@ -125,6 +127,7 @@
"@typescript-eslint/parser": "^5.31.0",
"all-contributors-cli": "^6.20.0",
"consola": "^2.15.3",
"cypress": "^10.3.0",
"cross-env": "^7.0.3",
"eslint": "^8.20.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
25 changes: 25 additions & 0 deletions pages/e2e-login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<div></div>
</template>

<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator'
import { mnemonicGenerate } from '@polkadot/util-crypto'
import keyring from '@polkadot/ui-keyring'

@Component({})
export default class E2ELogin extends Vue {
created() {
const mnemonic = mnemonicGenerate(12)
const { pair } = keyring.addUri(mnemonic, '', {
name: 'mnemonic acc',
})
// TODO: check 'loadAll' error, approx 1 in 10 tests fail without this
keyring.addPair(pair, '')
const account = pair.address
this.$store.dispatch('setAuth', { address: account })
localStorage.setItem('kodaauth', account)
this.$router.push('/')
}
}
</script>
Loading