move cypress into its own directory with package.json (#8627)

* move cypress into it's own directory with package.json

* update contributing and include cypress fixtures dir

* newline

* fix rebase

* add cypress dep

* bump cypress
This commit is contained in:
ʈᵃᵢ 2019-12-18 09:59:42 -08:00 committed by Maxime Beauchemin
parent 7a68cb7ca0
commit cbf860074b
51 changed files with 1767 additions and 329 deletions

View File

@ -55,7 +55,6 @@ little bit helps, and credit will always be given.
- [Merging DB migrations](#merging-db-migrations) - [Merging DB migrations](#merging-db-migrations)
- [SQL Lab Async](#sql-lab-async) - [SQL Lab Async](#sql-lab-async)
## Orientation ## Orientation
Here's a list of repositories that contain Superset-related packages: Here's a list of repositories that contain Superset-related packages:
@ -82,7 +81,6 @@ Here's a list of repositories that contain Superset-related packages:
Github organization under which we manage Superset-related Github organization under which we manage Superset-related
small tools, forks and Superset-related experimental ideas. small tools, forks and Superset-related experimental ideas.
## Types of Contributions ## Types of Contributions
### Report Bug ### Report Bug
@ -203,16 +201,16 @@ Triaging goals
First, add **Category labels (a.k.a. hash labels)**. Every issue/PR must have one hash label (except spam entry). Labels that begin with `#` defines issue/PR type: First, add **Category labels (a.k.a. hash labels)**. Every issue/PR must have one hash label (except spam entry). Labels that begin with `#` defines issue/PR type:
| Label | for Issue | for PR | | Label | for Issue | for PR |
|-------------------|-----------|--------| | --------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `#bug` | Bug report | Bug fix | | `#bug` | Bug report | Bug fix |
| `#code-quality` | Describe problem with code, architecture or productivity | Refactor, tests, tooling | | `#code-quality` | Describe problem with code, architecture or productivity | Refactor, tests, tooling |
| `#feature` | New feature request | New feature implementation | | `#feature` | New feature request | New feature implementation |
| `#refine` | Propose improvement that does not provide new features and is also not a bug fix nor refactor, such as adjust padding, refine UI style. | Implementation of improvement that does not provide new features and is also not a bug fix nor refactor, such as adjust padding, refine UI style. | | `#refine` | Propose improvement that does not provide new features and is also not a bug fix nor refactor, such as adjust padding, refine UI style. | Implementation of improvement that does not provide new features and is also not a bug fix nor refactor, such as adjust padding, refine UI style. |
| `#doc` | Documentation | Documentation | | `#doc` | Documentation | Documentation |
| `#question` | Troubleshooting: Installation, Running locally, Ask how to do something. Can be changed to `#bug` later. | N/A | | `#question` | Troubleshooting: Installation, Running locally, Ask how to do something. Can be changed to `#bug` later. | N/A |
| `#SIP` | Superset Improvement Proposal | N/A | | `#SIP` | Superset Improvement Proposal | N/A |
| `#ASF` | Tasks related to Apache Software Foundation policy | Tasks related to Apache Software Foundation policy | | `#ASF` | Tasks related to Apache Software Foundation policy | Tasks related to Apache Software Foundation policy |
Then add other types of labels as appropriate. Then add other types of labels as appropriate.
@ -370,8 +368,8 @@ superset load_examples
FLASK_ENV=development superset run -p 8088 --with-threads --reload --debugger FLASK_ENV=development superset run -p 8088 --with-threads --reload --debugger
``` ```
**Note: the FLASK_APP env var should not need to be set, as it's currently controlled **Note: the FLASK_APP env var should not need to be set, as it's currently controlled
via `.flaskenv`, however if needed, it should be set to `superset.app:create_app()`** via `.flaskenv`, however if needed, it should be set to `superset.app:create_app()`**
If you have made changes to the FAB-managed templates, which are not built the same way as the newer, React-powered front-end assets, you need to start the app without the `--with-threads` argument like so: If you have made changes to the FAB-managed templates, which are not built the same way as the newer, React-powered front-end assets, you need to start the app without the `--with-threads` argument like so:
`FLASK_ENV=development superset run -p 8088 --reload --debugger` `FLASK_ENV=development superset run -p 8088 --reload --debugger`
@ -472,12 +470,15 @@ best practices.
#### Feature flags #### Feature flags
Superset supports a server-wide feature flag system, which eases the incremental development of features. To add a new feature flag, simply modify `superset_config.py` with something like the following: Superset supports a server-wide feature flag system, which eases the incremental development of features. To add a new feature flag, simply modify `superset_config.py` with something like the following:
``` ```
FEATURE_FLAGS = { FEATURE_FLAGS = {
'SCOPED_FILTER': True, 'SCOPED_FILTER': True,
} }
``` ```
If you want to use the same flag in the client code, also add it to the FeatureFlag TypeScript enum in `superset/assets/src/featureFlags.ts`. For example, If you want to use the same flag in the client code, also add it to the FeatureFlag TypeScript enum in `superset/assets/src/featureFlags.ts`. For example,
``` ```
export enum FeatureFlag { export enum FeatureFlag {
SCOPED_FILTER = 'SCOPED_FILTER', SCOPED_FILTER = 'SCOPED_FILTER',
@ -514,7 +515,6 @@ npm run lint
The Python code is auto-formatted using [Black](https://github.com/python/black) which The Python code is auto-formatted using [Black](https://github.com/python/black) which
is configured as a pre-commit hook. There are also numerous [editor integrations](https://black.readthedocs.io/en/stable/editor_integration.html). is configured as a pre-commit hook. There are also numerous [editor integrations](https://black.readthedocs.io/en/stable/editor_integration.html).
## Conventions ## Conventions
### Python ### Python
@ -577,7 +577,6 @@ Note per [PEP-484](https://www.python.org/dev/peps/pep-0484/#exceptions) no
syntax for listing explicitly raised exceptions is proposed and thus the syntax for listing explicitly raised exceptions is proposed and thus the
recommendation is to put this information in a docstring, i.e., recommendation is to put this information in a docstring, i.e.,
```python ```python
import math import math
from typing import Union from typing import Union
@ -595,7 +594,6 @@ def sqrt(x: Union[float, int]) -> Union[float, int]:
return math.sqrt(x) return math.sqrt(x)
``` ```
### JavaScript Testing ### JavaScript Testing
We use [Jest](https://jestjs.io/) and [Enzyme](https://airbnb.io/enzyme/) to test Javascript. Tests can be run with: We use [Jest](https://jestjs.io/) and [Enzyme](https://airbnb.io/enzyme/) to test Javascript. Tests can be run with:
@ -623,7 +621,9 @@ Run Cypress tests:
```bash ```bash
cd superset/assets cd superset/assets
npm run build npm run build
npm run install-cypress
cd cypress-base
npm install
npm run cypress run npm run cypress run
# run tests from a specific file # run tests from a specific file
@ -631,6 +631,9 @@ npm run cypress run -- --spec cypress/integration/explore/link.test.js
# run specific file with video capture # run specific file with video capture
npm run cypress run -- --spec cypress/integration/dashboard/index.test.js --config video=true npm run cypress run -- --spec cypress/integration/dashboard/index.test.js --config video=true
# to open the cypress ui
npm run cypress open
``` ```
See [`superset/assets/cypress_build.sh`](https://github.com/apache/incubator-superset/blob/master/superset/assets/cypress_build.sh). See [`superset/assets/cypress_build.sh`](https://github.com/apache/incubator-superset/blob/master/superset/assets/cypress_build.sh).
@ -656,7 +659,7 @@ In JavaScript, the technique is similar:
we import `t` (simple translation), `tn` (translation containing a number). we import `t` (simple translation), `tn` (translation containing a number).
```javascript ```javascript
import { t, tn } from '@superset-ui/translation'; import { t, tn } from "@superset-ui/translation";
``` ```
### Enabling language selection ### Enabling language selection
@ -718,20 +721,20 @@ Then, [extract strings for the new language](#extracting-new-strings-for-transla
### Adding a new datasource ### Adding a new datasource
1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py 1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py
with models for cluster, datasources, columns and metrics and my_views.py with clustermodelview with models for cluster, datasources, columns and metrics and my_views.py with clustermodelview
and datasourcemodelview. and datasourcemodelview.
1. Create DB migration files for the new models 1. Create DB migration files for the new models
1. Specify this variable to add the datasource model and from which module it is from in config.py: 1. Specify this variable to add the datasource model and from which module it is from in config.py:
For example: For example:
```python ```python
ADDITIONAL_MODULE_DS_MAP = {'superset.my_models': ['MyDatasource', 'MyOtherDatasource']} ADDITIONAL_MODULE_DS_MAP = {'superset.my_models': ['MyDatasource', 'MyOtherDatasource']}
``` ```
This means it'll register MyDatasource and MyOtherDatasource in superset.my_models module in the source registry. This means it'll register MyDatasource and MyOtherDatasource in superset.my_models module in the source registry.
### Creating a new visualization type ### Creating a new visualization type
@ -743,51 +746,51 @@ https://github.com/apache/incubator-superset/pull/3013
1. Alter the model you want to change. This example will add a `Column` Annotations model. 1. Alter the model you want to change. This example will add a `Column` Annotations model.
[Example commit](https://github.com/apache/incubator-superset/commit/6c25f549384d7c2fc288451222e50493a7b14104) [Example commit](https://github.com/apache/incubator-superset/commit/6c25f549384d7c2fc288451222e50493a7b14104)
1. Generate the migration file 1. Generate the migration file
```bash ```bash
superset db migrate -m 'add_metadata_column_to_annotation_model.py' superset db migrate -m 'add_metadata_column_to_annotation_model.py'
``` ```
This will generate a file in `migrations/version/{SHA}_this_will_be_in_the_migration_filename.py`. This will generate a file in `migrations/version/{SHA}_this_will_be_in_the_migration_filename.py`.
[Example commit](https://github.com/apache/incubator-superset/commit/d3e83b0fd572c9d6c1297543d415a332858e262) [Example commit](https://github.com/apache/incubator-superset/commit/d3e83b0fd572c9d6c1297543d415a332858e262)
1. Upgrade the DB 1. Upgrade the DB
```bash ```bash
superset db upgrade superset db upgrade
``` ```
The output should look like this: The output should look like this:
``` ```
INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL. INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade 1a1d627ebd8e -> 40a0a483dd12, add_metadata_column_to_annotation_model.py INFO [alembic.runtime.migration] Running upgrade 1a1d627ebd8e -> 40a0a483dd12, add_metadata_column_to_annotation_model.py
``` ```
1. Add column to view 1. Add column to view
Since there is a new column, we need to add it to the AppBuilder Model view. Since there is a new column, we need to add it to the AppBuilder Model view.
[Example commit](https://github.com/apache/incubator-superset/pull/5745/commits/6220966e2a0a0cf3e6d87925491f8920fe8a3458) [Example commit](https://github.com/apache/incubator-superset/pull/5745/commits/6220966e2a0a0cf3e6d87925491f8920fe8a3458)
1. Test the migration's `down` method 1. Test the migration's `down` method
```bash ```bash
superset db downgrade superset db downgrade
``` ```
The output should look like this: The output should look like this:
``` ```
INFO [alembic.runtime.migration] Context impl SQLiteImpl. INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL. INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running downgrade 40a0a483dd12 -> 1a1d627ebd8e, add_metadata_column_to_annotation_model.py INFO [alembic.runtime.migration] Running downgrade 40a0a483dd12 -> 1a1d627ebd8e, add_metadata_column_to_annotation_model.py
``` ```
### Merging DB migrations ### Merging DB migrations
@ -804,23 +807,23 @@ To fix it:
1. Get the migration heads 1. Get the migration heads
```bash ```bash
superset db heads superset db heads
``` ```
This should list two or more migration hashes. This should list two or more migration hashes.
1. Create a new merge migration 1. Create a new merge migration
```bash ```bash
superset db merge {HASH1} {HASH2} superset db merge {HASH1} {HASH2}
``` ```
1. Upgrade the DB to the new checkpoint 1. Upgrade the DB to the new checkpoint
```bash ```bash
superset db upgrade superset db upgrade
``` ```
### SQL Lab Async ### SQL Lab Async
@ -828,30 +831,33 @@ It's possible to configure a local database to operate in `async` mode,
to work on `async` related features. to work on `async` related features.
To do this, you'll need to: To do this, you'll need to:
* Add an additional database entry. We recommend you copy the connection
- Add an additional database entry. We recommend you copy the connection
string from the database labeled `main`, and then enable `SQL Lab` and the string from the database labeled `main`, and then enable `SQL Lab` and the
features you want to use. Don't forget to check the `Async` box features you want to use. Don't forget to check the `Async` box
* Configure a results backend, here's a local `FileSystemCache` example, - Configure a results backend, here's a local `FileSystemCache` example,
not recommended for production, not recommended for production,
but perfect for testing (stores cache in `/tmp`) but perfect for testing (stores cache in `/tmp`)
```python ```python
from werkzeug.contrib.cache import FileSystemCache from werkzeug.contrib.cache import FileSystemCache
RESULTS_BACKEND = FileSystemCache('/tmp/sqllab') RESULTS_BACKEND = FileSystemCache('/tmp/sqllab')
``` ```
* Start up a celery worker * Start up a celery worker
```shell script ```shell script
celery worker --app=superset.tasks.celery_app:app -Ofair celery worker --app=superset.tasks.celery_app:app -Ofair
``` ```
Note that: Note that:
* for changes that affect the worker logic, you'll have to
- for changes that affect the worker logic, you'll have to
restart the `celery worker` process for the changes to be reflected. restart the `celery worker` process for the changes to be reflected.
* The message queue used is a `sqlite` database using the `SQLAlchemy` - The message queue used is a `sqlite` database using the `SQLAlchemy`
experimental broker. Ok for testing, but not recommended in production experimental broker. Ok for testing, but not recommended in production
* In some cases, you may want to create a context that is more aligned - In some cases, you may want to create a context that is more aligned
to your production environment, and use the similar broker as well as to your production environment, and use the similar broker as well as
results backend configuration results backend configuration
## Chart Parameters ## Chart Parameters
Chart parameters are stored as a JSON encoded string the `slices.params` column and are often referenced throughout the code as form-data. Currently the form-data is neither versioned nor typed as thus is somewhat free-formed. Note in the future there may be merit in using something like [JSON Schema](https://json-schema.org/) to both annotate and validate the JSON object in addition to using a Mypy `TypedDict` (introduced in Python 3.8) for typing the form-data in the backend. This section serves as a potential primer for that work. Chart parameters are stored as a JSON encoded string the `slices.params` column and are often referenced throughout the code as form-data. Currently the form-data is neither versioned nor typed as thus is somewhat free-formed. Note in the future there may be merit in using something like [JSON Schema](https://json-schema.org/) to both annotate and validate the JSON object in addition to using a Mypy `TypedDict` (introduced in Python 3.8) for typing the form-data in the backend. This section serves as a potential primer for that work.
@ -863,314 +869,312 @@ Note not all fields are correctly catagorized. The fields vary based on visualiz
### Datasource & Chart Type ### Datasource & Chart Type
| Field | Type | Notes | | Field | Type | Notes |
|-------------------|----------|-------------------------------------| | ----------------- | -------- | ----------------------------------- |
| `database_name` | *string* | *Deprecated?* | | `database_name` | _string_ | _Deprecated?_ |
| `datasource` | *string* | `<datasouce_id>__<datasource_type>` | | `datasource` | _string_ | `<datasouce_id>__<datasource_type>` |
| `datasource_id` | *string* | *Deprecated?* See `datasource` | | `datasource_id` | _string_ | _Deprecated?_ See `datasource` |
| `datasource_name` | *string* | *Deprecated?* | | `datasource_name` | _string_ | _Deprecated?_ |
| `datasource_type` | *string* | *Deprecated?* See `datasource` | | `datasource_type` | _string_ | _Deprecated?_ See `datasource` |
| `viz_type` | *string* | The **Visualization Type** widget | | `viz_type` | _string_ | The **Visualization Type** widget |
### Time ### Time
| Field | Type | Notes | | Field | Type | Notes |
|------------------------|-----------------|---------------------------------------| | ---------------------- | --------------- | ------------------------------------- |
| `date_filter` | *N/A* | *Deprecated?* | | `date_filter` | _N/A_ | _Deprecated?_ |
| `date_time_format` | *N/A* | *Deprecated?* | | `date_time_format` | _N/A_ | _Deprecated?_ |
| `druid_time_origin` | *string* | The Druid **Origin** widget | | `druid_time_origin` | _string_ | The Druid **Origin** widget |
| `granularity` | *string* | The Druid **Time Granularity** widget | | `granularity` | _string_ | The Druid **Time Granularity** widget |
| `granularity_sqla` | *string* | The SQLA **Time Column** widget | | `granularity_sqla` | _string_ | The SQLA **Time Column** widget |
| `time_grain_sqla` | *string* | The SQLA **Time Grain** widget | | `time_grain_sqla` | _string_ | The SQLA **Time Grain** widget |
| `time_range` | *string* | The **Time range** widget | | `time_range` | _string_ | The **Time range** widget |
| `time_range_endpoints` | *array(string)* | Used by SIP-15 [HIDDEN] | | `time_range_endpoints` | _array(string)_ | Used by SIP-15 [HIDDEN] |
### GROUP BY ### GROUP BY
| Field | Type | Notes | | Field | Type | Notes |
|---------------------------|-----------------|-----------------------------| | ------------------------- | --------------- | --------------------------- |
| `include_time` | *boolean* | The **Include Time** widget | | `include_time` | _boolean_ | The **Include Time** widget |
| `metrics` | *array(string)* | See Query section | | `metrics` | _array(string)_ | See Query section |
| `order_asc` | - | See Query section | | `order_asc` | - | See Query section |
| `percent_metrics` | - | See Query section | | `percent_metrics` | - | See Query section |
| `row_limit` | - | See Query section | | `row_limit` | - | See Query section |
| `timeseries_limit_metric` | - | See Query section | | `timeseries_limit_metric` | - | See Query section |
### NOT GROUPED BY ### NOT GROUPED BY
| Field | Type | Notes | | Field | Type | Notes |
|-----------------|-----------------|-------------------------| | --------------- | --------------- | ----------------------- |
| `all_columns` | *array(string)* | The **Columns** widget | | `all_columns` | _array(string)_ | The **Columns** widget |
| `order_by_cols` | *array(string)* | The **Ordering** widget | | `order_by_cols` | _array(string)_ | The **Ordering** widget |
| `row_limit` | - | See Query section | | `row_limit` | - | See Query section |
### Y Axis 1 ### Y Axis 1
| Field | Type | Notes | | Field | Type | Notes |
|-----------------|------|----------------------------------------------------| | --------------- | ---- | -------------------------------------------------- |
| `metric` | - | The **Left Axis Metric** widget. See Query section | | `metric` | - | The **Left Axis Metric** widget. See Query section |
| `y_axis_format` | - | See Y Axis section | | `y_axis_format` | - | See Y Axis section |
### Y Axis 2 ### Y Axis 2
| Field | Type | Notes | | Field | Type | Notes |
|-------------------|-----------------|-----------------------------------------------------| | ----------------- | -------- | --------------------------------------------------- |
| `metric_2` | - | The **Right Axis Metric** widget. See Query section | | `metric_2` | - | The **Right Axis Metric** widget. See Query section |
| `y_axis_2_format` | *string* | The **Right Axis Format** widget | | `y_axis_2_format` | _string_ | The **Right Axis Format** widget |
### Query ### Query
| Field | Type | Notes | | Field | Type | Notes |
|---------------------------|---------------------------------------------------|---------------------------------------------------| | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------- |
| `adhoc_filters` | *array(object)* | The **Filters** widget | | `adhoc_filters` | _array(object)_ | The **Filters** widget |
| `all_columns_x` | *array(string)* | The **Numeric Columns** widget | | `all_columns_x` | _array(string)_ | The **Numeric Columns** widget |
| `columns` | *array(string)* | The **Breakdowns** widget | | `columns` | _array(string)_ | The **Breakdowns** widget |
| `contribution` | *boolean* | The **Contribution** widget | | `contribution` | _boolean_ | The **Contribution** widget |
| `groupby` | *array(string)* | The **Group by** or **Series** widget | | `groupby` | _array(string)_ | The **Group by** or **Series** widget |
| `limit` | *number* | The **Series Limit** widget | | `limit` | _number_ | The **Series Limit** widget |
| `max_bubble_size` | *number* | The **Max Bubble Size** widget | | `max_bubble_size` | _number_ | The **Max Bubble Size** widget |
| `metric`<br>`metric_2`<br>`metrics`<br>`percent_mertics`<br>`secondary_metric`<br>`size`<br>`x`<br>`y` | *string*,*object*,*array(string)*,*array(object)* | The metric(s) depending on the visualization type | | `metric`<br>`metric_2`<br>`metrics`<br>`percent_mertics`<br>`secondary_metric`<br>`size`<br>`x`<br>`y` | _string_,_object_,_array(string)_,_array(object)_ | The metric(s) depending on the visualization type |
| `order_asc` | *boolean* | The **Sort Descending** widget | | `order_asc` | _boolean_ | The **Sort Descending** widget |
| `row_limit` | *number* | The **Row limit** widget | | `row_limit` | _number_ | The **Row limit** widget |
| `timeseries_limit_metric` | *object* | The **Sort By** widget | | `timeseries_limit_metric` | _object_ | The **Sort By** widget |
The `metric` (or equivalent) and `timeseries_limit_metric` fields are all composed of either metric names or the JSON representation of the `AdhocMetric` JavaScript type. The `adhoc_filters` is composed of the JSON represent of the `AdhocFilter` JavaScript type (which can comprise of columns or metrics depending on whether it is a WHERE or HAVING clause). The `all_columns`, `all_columns_x`, `columns`, `groupby`, and `order_by_cols` fields all represent column names. The `metric` (or equivalent) and `timeseries_limit_metric` fields are all composed of either metric names or the JSON representation of the `AdhocMetric` JavaScript type. The `adhoc_filters` is composed of the JSON represent of the `AdhocFilter` JavaScript type (which can comprise of columns or metrics depending on whether it is a WHERE or HAVING clause). The `all_columns`, `all_columns_x`, `columns`, `groupby`, and `order_by_cols` fields all represent column names.
### Filters Configuration ### Filters Configuration
| Field | Type | Notes | | Field | Type | Notes |
|------------------|---------------|-----------------------------------| | ---------------- | ------------- | --------------------------------- |
| `filter_configs` | array(object) | The filter-box **Filters** widget | | `filter_configs` | array(object) | The filter-box **Filters** widget |
The filter-box configuration references column names (via the `column` key) and optionally metric names (via the `metric` key) if sorting is defined. The filter-box configuration references column names (via the `column` key) and optionally metric names (via the `metric` key) if sorting is defined.
### Options ### Options
| Field | Type | Notes | | Field | Type | Notes |
|------------------------|-----------|--------------------------------------| | ---------------------- | --------- | ------------------------------------ |
| `compare_lag` | *number* | The **Comparison Period Lag** widget | | `compare_lag` | _number_ | The **Comparison Period Lag** widget |
| `compare_suffix` | *string* | The **Comparison suffix** widget | | `compare_suffix` | _string_ | The **Comparison suffix** widget |
| `show_trend_line` | *boolean* | The **Show Trend Line** widget | | `show_trend_line` | _boolean_ | The **Show Trend Line** widget |
| `start_y_axis_at_zero` | *boolean* | The **Start y-axis at 0** widget | | `start_y_axis_at_zero` | _boolean_ | The **Start y-axis at 0** widget |
### Chart Options ### Chart Options
| Field | Type | Notes | | Field | Type | Notes |
|-----------------------|-----------|--------------------------------------------------| | --------------------- | --------- | ------------------------------------------------ |
| `color_picker` | *object* | The **Fixed Color** widget | | `color_picker` | _object_ | The **Fixed Color** widget |
| `donut` | *boolean* | The **Donut** widget | | `donut` | _boolean_ | The **Donut** widget |
| `global_opacity` | *number* | The **Opacity** widget | | `global_opacity` | _number_ | The **Opacity** widget |
| `header_font_size` | *number* | The **Big Number Font Size** widget (or similar) | | `header_font_size` | _number_ | The **Big Number Font Size** widget (or similar) |
| `label_colors` | *object* | The **Color Scheme** widget | | `label_colors` | _object_ | The **Color Scheme** widget |
| `labels_outside` | *boolean* | The **Put labels outside** widget | | `labels_outside` | _boolean_ | The **Put labels outside** widget |
| `line_interpolation` | *string* | The **Line Style** widget | | `line_interpolation` | _string_ | The **Line Style** widget |
| `link_length` | *number* | The **No of Bins** widget | | `link_length` | _number_ | The **No of Bins** widget |
| `normalized` | *boolean* | The **Normalized** widget | | `normalized` | _boolean_ | The **Normalized** widget |
| `number_format` | *string* | The **Number format** widget | | `number_format` | _string_ | The **Number format** widget |
| `pie_label_type` | *string* | [HIDDEN] | | `pie_label_type` | _string_ | [HIDDEN] |
| `rich_tooltip` | *boolean* | The **Rich Tooltip** widget | | `rich_tooltip` | _boolean_ | The **Rich Tooltip** widget |
| `send_time_range` | *boolean* | The **Show Markers** widget | | `send_time_range` | _boolean_ | The **Show Markers** widget |
| `show_brush` | *string* | The **Show Range Filter** widget | | `show_brush` | _string_ | The **Show Range Filter** widget |
| `show_legend` | *boolean* | The **Legend** widget | | `show_legend` | _boolean_ | The **Legend** widget |
| `show_markers` | *string* | The **Show Markers** widget | | `show_markers` | _string_ | The **Show Markers** widget |
| `subheader_font_size` | *number* | The **Subheader Font Size** widget | | `subheader_font_size` | _number_ | The **Subheader Font Size** widget |
### X Axis ### X Axis
| Field | Type | Notes | | Field | Type | Notes |
|----------------------|-----------|------------------------------| | -------------------- | --------- | ---------------------------- |
| `bottom_margin` | *string* | The **Bottom Margin** widget | | `bottom_margin` | _string_ | The **Bottom Margin** widget |
| `x_axis_format` | *string* | The **X Axis Format** widget | | `x_axis_format` | _string_ | The **X Axis Format** widget |
| `x_axis_label` | *string* | The **X Axis Label** widget | | `x_axis_label` | _string_ | The **X Axis Label** widget |
| `x_axis_showminmax` | *boolean* | The **X bounds** widget | | `x_axis_showminmax` | _boolean_ | The **X bounds** widget |
| `x_axis_time_format` | *N/A* | *Deprecated?* | | `x_axis_time_format` | _N/A_ | _Deprecated?_ |
| `x_log_scale` | *N/A* | *Deprecated?* | | `x_log_scale` | _N/A_ | _Deprecated?_ |
| `x_ticks_layout` | *string* | The **X Tick Layout** widget | | `x_ticks_layout` | _string_ | The **X Tick Layout** widget |
### Y Axis ### Y Axis
| Field | Type | Notes | | Field | Type | Notes |
|---------------------|-----------------|------------------------------| | ------------------- | --------------- | ---------------------------- |
| `left_margin` | *number* | The **Left Margin** widget | | `left_margin` | _number_ | The **Left Margin** widget |
| `y_axis_2_label` | *N/A* | *Deprecated?* | | `y_axis_2_label` | _N/A_ | _Deprecated?_ |
| `y_axis_bounds` | *array(string)* | The **Y Axis Bounds** widget | | `y_axis_bounds` | _array(string)_ | The **Y Axis Bounds** widget |
| `y_axis_format` | *string* | The **Y Axis Format** widget | | `y_axis_format` | _string_ | The **Y Axis Format** widget |
| `y_axis_label` | *string* | The **Y Axis Label** widget | | `y_axis_label` | _string_ | The **Y Axis Label** widget |
| `y_axis_showminmax` | *boolean* | The **Y bounds** widget | | `y_axis_showminmax` | _boolean_ | The **Y bounds** widget |
| `y_axis_zero` | *N/A* | *Deprecated?* | | `y_axis_zero` | _N/A_ | _Deprecated?_ |
| `y_log_scale` | *boolean* | The **Y Log Scale** widget | | `y_log_scale` | _boolean_ | The **Y Log Scale** widget |
| `yscale_interval` | *N/A* | *Deprecated?* | | `yscale_interval` | _N/A_ | _Deprecated?_ |
Note the `y_axis_format` is defined under various section for some charts. Note the `y_axis_format` is defined under various section for some charts.
### Other ### Other
| Field | Type | Notes | | Field | Type | Notes |
|----------------|----------|--------------| | -------------- | -------- | ------------ |
| `color_scheme` | *string* | | | `color_scheme` | _string_ | |
| `slice_id` | *number* | The slice ID | | `slice_id` | _number_ | The slice ID |
| `url_params` | *object* | | | `url_params` | _object_ | |
### Unclassified ### Unclassified
| Field | Type | Notes | | Field | Type | Notes |
|---------------------------------|-------|-------| | ------------------------------- | ----- | ----- |
| `add_to_dash` | *N/A* | | | `add_to_dash` | _N/A_ | |
| `align_pn` | *N/A* | | | `align_pn` | _N/A_ | |
| `all_columns_y` | *N/A* | | | `all_columns_y` | _N/A_ | |
| `annotation_layers` | *N/A* | | | `annotation_layers` | _N/A_ | |
| `autozoom` | *N/A* | | | `autozoom` | _N/A_ | |
| `bar_stacked` | *N/A* | | | `bar_stacked` | _N/A_ | |
| `cache_timeout` | *N/A* | | | `cache_timeout` | _N/A_ | |
| `canvas_image_rendering` | *N/A* | | | `canvas_image_rendering` | _N/A_ | |
| `cell_padding` | *N/A* | | | `cell_padding` | _N/A_ | |
| `cell_radius` | *N/A* | | | `cell_radius` | _N/A_ | |
| `cell_size` | *N/A* | | | `cell_size` | _N/A_ | |
| `charge` | *N/A* | | | `charge` | _N/A_ | |
| `clustering_radius` | *N/A* | | | `clustering_radius` | _N/A_ | |
| `code` | *N/A* | | | `code` | _N/A_ | |
| `collapsed_fieldsets` | *N/A* | | | `collapsed_fieldsets` | _N/A_ | |
| `color_pn` | *N/A* | | | `color_pn` | _N/A_ | |
| `column_collection` | *N/A* | | | `column_collection` | _N/A_ | |
| `combine_metric` | *N/A* | | | `combine_metric` | _N/A_ | |
| `comparison type` | *N/A* | | | `comparison type` | _N/A_ | |
| `contribution` | *N/A* | | | `contribution` | _N/A_ | |
| `country_fieldtype` | *N/A* | | | `country_fieldtype` | _N/A_ | |
| `date_filter` | *N/A* | | | `date_filter` | _N/A_ | |
| `deck_slices` | *N/A* | | | `deck_slices` | _N/A_ | |
| `default_filters` | *N/A* | | | `default_filters` | _N/A_ | |
| `dimension` | *N/A* | | | `dimension` | _N/A_ | |
| `domain_granularity` | *N/A* | | | `domain_granularity` | _N/A_ | |
| `end_spatial` | *N/A* | | | `end_spatial` | _N/A_ | |
| `entity` | *N/A* | | | `entity` | _N/A_ | |
| `equal_date_size` | *N/A* | | | `equal_date_size` | _N/A_ | |
| `expanded_slices` | *N/A* | | | `expanded_slices` | _N/A_ | |
| `extra_filters` | *N/A* | | | `extra_filters` | _N/A_ | |
| `extruded` | *N/A* | | | `extruded` | _N/A_ | |
| `fill_color_picker` | *N/A* | | | `fill_color_picker` | _N/A_ | |
| `filled` | *N/A* | | | `filled` | _N/A_ | |
| `filter_immune_slice_fields` | *N/A* | | | `filter_immune_slice_fields` | _N/A_ | |
| `filter_immune_slices` | *N/A* | | | `filter_immune_slices` | _N/A_ | |
| `filter_nulls` | *N/A* | | | `filter_nulls` | _N/A_ | |
| `flt_col_0` | *N/A* | | | `flt_col_0` | _N/A_ | |
| `flt_col_1` | *N/A* | | | `flt_col_1` | _N/A_ | |
| `flt_eq_0` | *N/A* | | | `flt_eq_0` | _N/A_ | |
| `flt_eq_1` | *N/A* | | | `flt_eq_1` | _N/A_ | |
| `flt_op_0` | *N/A* | | | `flt_op_0` | _N/A_ | |
| `flt_op_1` | *N/A* | | | `flt_op_1` | _N/A_ | |
| `goto_dash` | *N/A* | | | `goto_dash` | _N/A_ | |
| `grid_size` | *N/A* | | | `grid_size` | _N/A_ | |
| `horizon_color_scale` | *N/A* | | | `horizon_color_scale` | _N/A_ | |
| `import_time` | *N/A* | | | `import_time` | _N/A_ | |
| `include_search` | *N/A* | | | `include_search` | _N/A_ | |
| `include_series` | *N/A* | | | `include_series` | _N/A_ | |
| `instant_filtering` | *N/A* | | | `instant_filtering` | _N/A_ | |
| `js_agg_function` | *N/A* | | | `js_agg_function` | _N/A_ | |
| `js_columns` | *N/A* | | | `js_columns` | _N/A_ | |
| `label` | *N/A* | | | `label` | _N/A_ | |
| `labels_outside` | *N/A* | | | `labels_outside` | _N/A_ | |
| `legend_position` | *N/A* | | | `legend_position` | _N/A_ | |
| `line_charts` | *N/A* | | | `line_charts` | _N/A_ | |
| `line_charts_2` | *N/A* | | | `line_charts_2` | _N/A_ | |
| `line_column` | *N/A* | | | `line_column` | _N/A_ | |
| `line_type` | *N/A* | | | `line_type` | _N/A_ | |
| `line_width` | *N/A* | | | `line_width` | _N/A_ | |
| `linear_color_scheme` | *N/A* | | | `linear_color_scheme` | _N/A_ | |
| `log_scale` | *N/A* | | | `log_scale` | _N/A_ | |
| `mapbox_color` | *N/A* | | | `mapbox_color` | _N/A_ | |
| `mapbox_label` | *N/A* | | | `mapbox_label` | _N/A_ | |
| `mapbox_style` | *N/A* | | | `mapbox_style` | _N/A_ | |
| `marker_labels` | *N/A* | | | `marker_labels` | _N/A_ | |
| `marker_line_labels` | *N/A* | | | `marker_line_labels` | _N/A_ | |
| `marker_lines` | *N/A* | | | `marker_lines` | _N/A_ | |
| `markers` | *N/A* | | | `markers` | _N/A_ | |
| `markup_type` | *N/A* | | | `markup_type` | _N/A_ | |
| `max_radius` | *N/A* | | | `max_radius` | _N/A_ | |
| `min_leaf_node_event_count` | *N/A* | | | `min_leaf_node_event_count` | _N/A_ | |
| `min_periods` | *N/A* | | | `min_periods` | _N/A_ | |
| `min_radius` | *N/A* | | | `min_radius` | _N/A_ | |
| `multiplier` | *N/A* | | | `multiplier` | _N/A_ | |
| `new_dashboard_name` | *N/A* | | | `new_dashboard_name` | _N/A_ | |
| `new_slice_name` | *N/A* | | | `new_slice_name` | _N/A_ | |
| `normalize_across` | *N/A* | | | `normalize_across` | _N/A_ | |
| `num_buckets` | *N/A* | | | `num_buckets` | _N/A_ | |
| `num_period_compare` | *N/A* | | | `num_period_compare` | _N/A_ | |
| `order_bars` | *N/A* | | | `order_bars` | _N/A_ | |
| `order_by_entity` | *N/A* | | | `order_by_entity` | _N/A_ | |
| `order_desc` | *N/A* | | | `order_desc` | _N/A_ | |
| `page_length` | *N/A* | | | `page_length` | _N/A_ | |
| `pandas_aggfunc` | *N/A* | | | `pandas_aggfunc` | _N/A_ | |
| `partition_limit` | *N/A* | | | `partition_limit` | _N/A_ | |
| `partition_threshold` | *N/A* | | | `partition_threshold` | _N/A_ | |
| `period_ratio_type` | *N/A* | | | `period_ratio_type` | _N/A_ | |
| `perm` | *N/A* | | | `perm` | _N/A_ | |
| `pivot_margins` | *N/A* | | | `pivot_margins` | _N/A_ | |
| `point_radius` | *N/A* | | | `point_radius` | _N/A_ | |
| `point_radius_fixed` | *N/A* | | | `point_radius_fixed` | _N/A_ | |
| `point_radius_unit` | *N/A* | | | `point_radius_unit` | _N/A_ | |
| `point_unit` | *N/A* | | | `point_unit` | _N/A_ | |
| `prefix_metric_with_slice_name` | *N/A* | | | `prefix_metric_with_slice_name` | _N/A_ | |
| `range_labels` | *N/A* | | | `range_labels` | _N/A_ | |
| `ranges` | *N/A* | | | `ranges` | _N/A_ | |
| `rdo_save` | *N/A* | | | `rdo_save` | _N/A_ | |
| `reduce_x_ticks` | *N/A* | | | `reduce_x_ticks` | _N/A_ | |
| `refresh_frequency` | *N/A* | | | `refresh_frequency` | _N/A_ | |
| `remote_id` | *N/A* | | | `remote_id` | _N/A_ | |
| `render_while_dragging` | *N/A* | | | `render_while_dragging` | _N/A_ | |
| `resample_fillmethod` | *N/A* | | | `resample_fillmethod` | _N/A_ | |
| `resample_how` | *N/A* | | | `resample_how` | _N/A_ | |
| `resample_method` | *N/A* | | | `resample_method` | _N/A_ | |
| `resample_rule` | *N/A* | | | `resample_rule` | _N/A_ | |
| `reverse_long_lat` | *N/A* | | | `reverse_long_lat` | _N/A_ | |
| `rolling_periods` | *N/A* | | | `rolling_periods` | _N/A_ | |
| `rolling_type` | *N/A* | | | `rolling_type` | _N/A_ | |
| `rose_area_proportion` | *N/A* | | | `rose_area_proportion` | _N/A_ | |
| `rotation` | *N/A* | | | `rotation` | _N/A_ | |
| `save_to_dashboard_id` | *N/A* | | | `save_to_dashboard_id` | _N/A_ | |
| `schema` | *N/A* | | | `schema` | _N/A_ | |
| `select_country` | *N/A* | | | `select_country` | _N/A_ | |
| `series` | *N/A* | | | `series` | _N/A_ | |
| `series_height` | *N/A* | | | `series_height` | _N/A_ | |
| `show_bar_value` | *N/A* | | | `show_bar_value` | _N/A_ | |
| `show_brush` | *N/A* | | | `show_brush` | _N/A_ | |
| `show_bubbles` | *N/A* | | | `show_bubbles` | _N/A_ | |
| `show_controls` | *N/A* | | | `show_controls` | _N/A_ | |
| `show_datatable` | *N/A* | | | `show_datatable` | _N/A_ | |
| `show_druid_time_granularity` | *N/A* | | | `show_druid_time_granularity` | _N/A_ | |
| `show_druid_time_origin` | *N/A* | | | `show_druid_time_origin` | _N/A_ | |
| `show_labels` | *N/A* | | | `show_labels` | _N/A_ | |
| `show_metric_name` | *N/A* | | | `show_metric_name` | _N/A_ | |
| `show_perc` | *N/A* | | | `show_perc` | _N/A_ | |
| `show_sqla_time_column` | *N/A* | | | `show_sqla_time_column` | _N/A_ | |
| `show_sqla_time_granularity` | *N/A* | | | `show_sqla_time_granularity` | _N/A_ | |
| `show_values` | *N/A* | | | `show_values` | _N/A_ | |
| `size_from` | *N/A* | | | `size_from` | _N/A_ | |
| `size_to` | *N/A* | | | `size_to` | _N/A_ | |
| `slice_name` | *N/A* | | | `slice_name` | _N/A_ | |
| `sort_x_axis` | *N/A* | | | `sort_x_axis` | _N/A_ | |
| `sort_y_axis` | *N/A* | | | `sort_y_axis` | _N/A_ | |
| `spatial` | *N/A* | | | `spatial` | _N/A_ | |
| `stacked_style` | *N/A* | | | `stacked_style` | _N/A_ | |
| `start_spatial` | *N/A* | | | `start_spatial` | _N/A_ | |
| `steps` | *N/A* | | | `steps` | _N/A_ | |
| `stroke_color_picker` | *N/A* | | | `stroke_color_picker` | _N/A_ | |
| `stroke_width` | *N/A* | | | `stroke_width` | _N/A_ | |
| `stroked` | *N/A* | | | `stroked` | _N/A_ | |
| `subdomain_granularity` | *N/A* | | | `subdomain_granularity` | _N/A_ | |
| `subheader` | *N/A* | | | `subheader` | _N/A_ | |
| `table_filter` | *N/A* | | | `table_filter` | _N/A_ | |
| `table_timestamp_format` | *N/A* | | | `table_timestamp_format` | _N/A_ | |
| `time_compare` | *N/A* | | | `time_compare` | _N/A_ | |
| `time_series_option` | *N/A* | | | `time_series_option` | _N/A_ | |
| `timed_refresh_immune_slices` | *N/A* | | | `timed_refresh_immune_slices` | _N/A_ | |
| `toggle_polygons` | *N/A* | | | `toggle_polygons` | _N/A_ | |
| `transpose_pivot` | *N/A* | | | `transpose_pivot` | _N/A_ | |
| `treemap_ratio` | *N/A* | | | `treemap_ratio` | _N/A_ | |
| `url` | *N/A* | | | `url` | _N/A_ | |
| `userid` | *N/A* | | | `userid` | _N/A_ | |
| `viewport` | *N/A* | | | `viewport` | _N/A_ | |
| `viewport_latitude` | *N/A* | | | `viewport_latitude` | _N/A_ | |
| `viewport_longitude` | *N/A* | | | `viewport_longitude` | _N/A_ | |
| `viewport_zoom` | *N/A* | | | `viewport_zoom` | _N/A_ | |
| `whisker_options` | *N/A* | | | `whisker_options` | _N/A_ | |

View File

@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,15 @@
{
"name": "superset-cypress",
"version": "1.0.0",
"description": "run cypress against superset",
"scripts": {
"cypress": "cypress",
"cypress-debug": "cypress open --config watchForFileChanges=true"
},
"author": "Apcahe",
"license": "Apache-2.0",
"dependencies": {
"cypress": "^3.6.1",
"shortid": "^2.2.15"
}
}

View File

@ -29,10 +29,12 @@ flask run -p 8081 --with-threads --reload --debugger &
#block on the longer running javascript process #block on the longer running javascript process
time npm ci time npm ci
time npm run install-cypress
time npm run build time npm run build
echo "[completed js build steps]" echo "[completed js build steps]"
#setup cypress
cd cypress-base
time npm ci
CYPRESS_PATH='cypress/integration/'${1}'/*' CYPRESS_PATH='cypress/integration/'${1}'/*'
time npm run cypress run -- --spec "$CYPRESS_PATH" --record false --config video=false time npm run cypress run -- --spec "$CYPRESS_PATH" --record false --config video=false

View File

@ -17,10 +17,7 @@
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors --progress", "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production webpack --mode=production --colors --progress",
"lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json ./{src,spec}/**/*.ts{,x}", "lint": "eslint --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json ./{src,spec}/**/*.ts{,x}",
"lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json --fix ./{src,spec}/**/*.ts{,x} && npm run clean-css", "lint-fix": "eslint --fix --ignore-path=.eslintignore --ext .js,.jsx . && tslint -c tslint.json --fix ./{src,spec}/**/*.ts{,x} && npm run clean-css",
"clean-css": "prettier --write 'src/**/*.{css,less,sass,scss}'", "clean-css": "prettier --write 'src/**/*.{css,less,sass,scss}'"
"cypress": "cypress",
"cypress-debug": "cypress open --config watchForFileChanges=true",
"install-cypress": "npm install cypress@3.6.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",