Skip to content

Commit

Permalink
❄️ amp-base-carousel e2e test modifications (#32113)
Browse files Browse the repository at this point in the history
* Add versions to test names

* Increase/add test timeouts

* () => {} to function() {}
  • Loading branch information
caroqliu committed Jan 21, 2021
1 parent 3681ad1 commit 926e230
Show file tree
Hide file tree
Showing 30 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-advance.js
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 500;
const pageHeight = 800;

describes.endtoend(
'AMP carousel advance',
'amp-base-carousel:0.1 - advance',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/advance.amp.html',
Expand Down
Expand Up @@ -22,7 +22,7 @@ const pageWidth = 600;
const pageHeight = 600;

describes.endtoend(
'AMP carousel arrows when non-looping',
'amp-base-carousel:0.1 - arrows when non-looping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/non-looping.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-arrows.js
Expand Up @@ -20,7 +20,7 @@ import {getNextArrow, getPrevArrow, getSlide} from './helpers';
const SLIDE_COUNT = 7;

describes.endtoend(
'AMP carousel arrows with custom arrows',
'amp-base-carousel:0.1 - arrows with custom arrows',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/custom-arrows.amp.html',
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel autoadvance',
'amp-base-carousel:0.1 - autoadvance',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/autoadvance.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-carousel.js
Expand Up @@ -23,7 +23,7 @@ const pageHeight = 600;
const testTimeout = 20000;

describes.endtoend(
'AMP carousel',
'amp-base-carousel:0.1 - basic functionality',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/basic.amp.html',
Expand Down
Expand Up @@ -18,7 +18,7 @@ const pageWidth = 800;
const pageHeight = 800;

describes.endtoend(
'AMP carousel test default attributes',
'amp-base-carousel:0.1 - default attributes',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/default-attributes.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-grouping.js
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel grouping',
'amp-base-carousel:0.1 - grouping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
Expand Up @@ -17,7 +17,7 @@
import {getNextArrow} from './helpers';

describes.endtoend(
'AMP carousel arrows with hidden controls',
'amp-base-carousel:0.1 - arrows with hidden controls',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/hidden-controls.amp.html',
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 600;
const pageHeight = 600;

describes.endtoend(
'AMP carousel',
'amp-base-carousel:0.1 - initial slide',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel mixed length slides',
'amp-base-carousel:0.1 - mixed length slides without snapping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel mixed length slides',
'amp-base-carousel:0.1 - mixed length slides',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
Expand Up @@ -17,7 +17,7 @@
import {getNextArrow, getPrevArrow, getSlides, sleep} from './helpers';

describes.endtoend(
'AMP carousel advancing with multiple visible',
'amp-base-carousel:0.1 - advancing with multiple visible slides',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/multi-visible-single-advance.amp.html',
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'Non-looping AMP carousel',
'amp-base-carousel:0.1 - non-looping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 1000;
const pageHeight = 600;

describes.endtoend(
'AMP Carousel responsive attributes',
'amp-base-carousel:0.1 - responsive attributes',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-rtl.js
Expand Up @@ -21,7 +21,7 @@ const pageHeight = 600;
const arrowMargin = 12;

describes.endtoend(
'AMP carousel rtl',
'amp-base-carousel:0.1 - rtl',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/basic-rtl.amp.html',
Expand Down
Expand Up @@ -17,7 +17,7 @@
import {getSlides, getSpacers} from './helpers';

describes.endtoend(
'amp-base-carousel test snap property',
'amp-base-carousel:0.1 - snap property',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/snap-property.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/0.1/test-e2e/test-vertical.js
Expand Up @@ -20,7 +20,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'Vertical AMP carousel',
'amp-base-carousel:0.1 - vertical orientation',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/' +
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/1.0/test-e2e/test-advance.js
Expand Up @@ -27,7 +27,7 @@ const pageWidth = 500;
const pageHeight = 800;

describes.endtoend(
'AMP carousel advance',
'amp-base-carousel:1.0 - advance',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/advance.amp.html',
Expand Down
Expand Up @@ -27,8 +27,11 @@ const SLIDE_COUNT = 4;
const pageWidth = 600;
const pageHeight = 600;

/** Increase timeout for running on CircleCI **/
const testTimeout = 40000;

describes.endtoend(
'AMP carousel arrows when non-looping',
'amp-base-carousel:1.0 - arrows when non-looping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/non-looping.amp.html',
Expand All @@ -46,7 +49,8 @@ describes.endtoend(
return controller.getElementCssValue(handle, name);
}

beforeEach(async () => {
beforeEach(async function () {
this.timeout(testTimeout);
controller = env.controller;
const carousel = await getCarousel(controller);
await controller.switchToShadowRoot(carousel);
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/1.0/test-e2e/test-arrows.js
Expand Up @@ -26,7 +26,7 @@ import {useStyles} from '../base-carousel.jss';
const SLIDE_COUNT = 7;

describes.endtoend(
'AMP carousel arrows with custom arrows',
'amp-base-carousel:1.0 - arrows with custom arrows',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/custom-arrows.amp.html',
Expand Down
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel autoadvance',
'amp-base-carousel:1.0 - autoadvance',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/autoadvance.amp.html',
Expand Down
6 changes: 3 additions & 3 deletions extensions/amp-base-carousel/1.0/test-e2e/test-carousel.js
Expand Up @@ -20,11 +20,11 @@ import {useStyles} from '../base-carousel.jss';
const pageWidth = 800;
const pageHeight = 600;

/** Increase timeout for running on Travis macOS **/
const testTimeout = 30000;
/** Increase timeout for running on CircleCI **/
const testTimeout = 40000;

describes.endtoend(
'AMP carousel',
'amp-base-carousel:1.0 - basic functionality',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/basic.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/1.0/test-e2e/test-grouping.js
Expand Up @@ -25,7 +25,7 @@ const pivotIndex = Math.floor(slideCount / 2);
const expectedScrollPosition = (pageWidth / advanceCount) * pivotIndex;

describes.endtoend(
'AMP carousel grouping',
'amp-base-carousel:1.0 - grouping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand Down
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel mixed length slides',
'amp-base-carousel:1.0 - mixed length slides without snapping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand Down
11 changes: 8 additions & 3 deletions extensions/amp-base-carousel/1.0/test-e2e/test-mixed-lengths.js
Expand Up @@ -20,8 +20,11 @@ import {useStyles} from '../base-carousel.jss';
const pageWidth = 800;
const pageHeight = 600;

/** Increase timeout for running on CircleCI **/
const testTimeout = 40000;

describes.endtoend(
'AMP carousel mixed length slides',
'amp-base-carousel:1.0 - mixed length slides',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand All @@ -48,7 +51,8 @@ describes.endtoend(
describe('snap', () => {
const slideWidth = pageWidth * 0.75;

it('should have the correct initial slide positions', async () => {
it('should have the correct initial slide positions', async function () {
this.timeout(testTimeout);
const slideOne = await getSlide(styles, controller, 0);
const slideTwo = await getSlide(styles, controller, 1);

Expand All @@ -63,7 +67,8 @@ describes.endtoend(
});
});

it('should snap on the center point', async () => {
it('should snap on the center point', async function () {
this.timeout(testTimeout);
const el = await getScrollingElement(styles, controller);
const slideTwo = await getSlide(styles, controller, 1);
const scrollAmount = 1;
Expand Down
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'Non-looping AMP carousel',
'amp-base-carousel:1.0 - non-looping',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand Down
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 1000;
const pageHeight = 600;

describes.endtoend(
'AMP Carousel responsive attributes',
'amp-base-carousel:1.0 - responsive attributes',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/1.0/test-e2e/test-rtl.js
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 800;
const pageHeight = 600;

describes.endtoend(
'AMP carousel rtl',
'amp-base-carousel:1.0 - rtl',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/basic-rtl.amp.html',
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-base-carousel/1.0/test-e2e/test-vertical.js
Expand Up @@ -21,7 +21,7 @@ const pageWidth = 600;
const pageHeight = 600;

describes.endtoend(
'Vertical AMP carousel',
'amp-base-carousel:1.0 - vertical orientation',
{
testUrl:
'http://localhost:8000/test/manual/amp-base-carousel/1.0/' +
Expand Down
Expand Up @@ -28,7 +28,7 @@ import {useStyles} from '../base-carousel.jss';
import {waitFor, whenCalled} from '../../../../testing/test-helper';

describes.realWin(
'amp-base-carousel',
'amp-base-carousel:1.0',
{
amp: {
runtimeOn: true,
Expand Down

0 comments on commit 926e230

Please sign in to comment.